MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / get

Method get

libraries/AP_Scripting/AP_Scripting_helpers.cpp:109–135  ·  view source on GitHub ↗

get value

Source from the content-addressed store, hash-verified

107
108// get value
109bool Parameter::get(float &value)
110{
111 if (vp == nullptr) {
112 return false;
113 }
114 switch (vtype) {
115 case AP_PARAM_INT8:
116 value = ((AP_Int8 *)vp)->get();
117 break;
118 case AP_PARAM_INT16:
119 value = ((AP_Int16 *)vp)->get();
120 break;
121
122 case AP_PARAM_INT32:
123 value = ((AP_Int32 *)vp)->get();
124 break;
125
126 case AP_PARAM_FLOAT:
127 value = ((AP_Float *)vp)->get();
128 break;
129
130 default:
131 // not a supported type
132 return false;
133 }
134 return true;
135}
136
137// set and save value
138bool Parameter::set_and_save(float value)

Callers 15

initMethod · 0.45
Log_WriteMethod · 0.45
loopMethod · 0.45
option_is_setMethod · 0.45
get_disabled_dirMethod · 0.45
option_is_setMethod · 0.45
option_clearMethod · 0.45
arming_checksMethod · 0.45
lua_get_i2c_deviceFunction · 0.45
get_protocolMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected