Path: blob/master/libraries/AP_CRSF/AP_CRSF_Protocol.cpp
9424 views
/*1* This file is free software: you can redistribute it and/or modify it2* under the terms of the GNU General Public License as published by the3* Free Software Foundation, either version 3 of the License, or4* (at your option) any later version.5*6* This file is distributed in the hope that it will be useful, but7* WITHOUT ANY WARRANTY; without even the implied warranty of8* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.9* See the GNU General Public License for more details.10*11* You should have received a copy of the GNU General Public License along12* with this program. If not, see <http://www.gnu.org/licenses/>.13*/1415#include "AP_CRSF_Protocol.h"1617#if AP_CRSF_ENABLED1819// get printable name for frame type (for debug)20const char* AP_CRSF_Protocol::get_frame_type(uint8_t byte, uint8_t subtype)21{22switch (byte) {23case CRSF_FRAMETYPE_GPS:24return "GPS";25case CRSF_FRAMETYPE_BATTERY_SENSOR:26return "BATTERY";27case CRSF_FRAMETYPE_HEARTBEAT:28return "HEARTBEAT";29case CRSF_FRAMETYPE_VTX:30return "VTX";31case CRSF_FRAMETYPE_VTX_TELEM:32return "VTX_TELEM";33case CRSF_FRAMETYPE_PARAM_DEVICE_PING:34return "PING";35case CRSF_FRAMETYPE_COMMAND:36return "COMMAND";37case CRSF_FRAMETYPE_ATTITUDE:38return "ATTITUDE";39case CRSF_FRAMETYPE_FLIGHT_MODE:40return "FLIGHT_MODE";41case CRSF_FRAMETYPE_PARAM_DEVICE_INFO:42return "DEVICE_INFO";43case CRSF_FRAMETYPE_PARAMETER_READ:44return "PARAM_READ";45case CRSF_FRAMETYPE_PARAMETER_SETTINGS_ENTRY:46return "SETTINGS_ENTRY";47case CRSF_FRAMETYPE_LINK_STATISTICS:48return "LINK_STATS";49case CRSF_FRAMETYPE_RC_CHANNELS_PACKED:50return "RC";51case CRSF_FRAMETYPE_SUBSET_RC_CHANNELS_PACKED:52return "RCv3";53case CRSF_FRAMETYPE_RC_CHANNELS_PACKED_11BIT:54return "RCv3_11BIT";55case CRSF_FRAMETYPE_LINK_STATISTICS_RX:56return "LINK_STATSv3_RX";57case CRSF_FRAMETYPE_LINK_STATISTICS_TX:58return "LINK_STATSv3_TX";59case CRSF_FRAMETYPE_PARAMETER_WRITE:60return "PARAM_WRITE";61case CRSF_FRAMETYPE_AP_CUSTOM_TELEM_LEGACY:62case CRSF_FRAMETYPE_AP_CUSTOM_TELEM:63switch (subtype) {64case CRSF_AP_CUSTOM_TELEM_SINGLE_PACKET_PASSTHROUGH:65return "AP_CUSTOM_SINGLE";66case CRSF_AP_CUSTOM_TELEM_STATUS_TEXT:67return "AP_CUSTOM_TEXT";68case CRSF_AP_CUSTOM_TELEM_MULTI_PACKET_PASSTHROUGH:69return "AP_CUSTOM_MULTI";70}71return "AP_CUSTOM";72}73return "UNKNOWN";74}7576#endif // AP_CRSF_ENABLED777879