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

Method set

libraries/AP_Scripting/AP_Scripting_helpers.cpp:83–106  ·  view source on GitHub ↗

set a value

Source from the content-addressed store, hash-verified

81
82// set a value
83bool Parameter::set(float value)
84{
85 if (vp == nullptr) {
86 return false;
87 }
88 switch (vtype) {
89 case AP_PARAM_INT8:
90 ((AP_Int8 *)vp)->set(value);
91 return true;
92 case AP_PARAM_INT16:
93 ((AP_Int16 *)vp)->set(value);
94 return true;
95 case AP_PARAM_INT32:
96 ((AP_Int32 *)vp)->set(value);
97 return true;
98 case AP_PARAM_FLOAT:
99 ((AP_Float *)vp)->set(value);
100 return true;
101 default:
102 break;
103 }
104 // not a supported type
105 return false;
106}
107
108// get value
109bool Parameter::get(float &value)

Callers 5

initMethod · 0.45
task_infoMethod · 0.45
initMethod · 0.45
set_protocol_and_baudMethod · 0.45
initMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected