172 std::vector<int8_t> bf;
174 bf.push_back((int8_t) (*it & 0xFF));
177 int8_t pl_size = (int8_t) ((!payload.empty() ? (int) (payload.size()) : 0) & 0xFF);
178 bf.push_back(pl_size);
179 checksum ^= (pl_size & 0xFF);
181 bf.push_back((int8_t) (msp & 0xFF));
182 checksum ^= (msp & 0xFF);
184 if (!payload.empty()) {
186 for (std::vector<int8_t>::iterator it = payload.begin() ; it != payload.end(); ++it) {
189 bf.push_back((int8_t) (k & 0xFF));
190 checksum ^= (k & 0xFF);
193 bf.push_back(checksum);
199 std::vector<int8_t>rc_signals(16);
201 for (
int i = 0;
i < 8;
i++) {
203 rc_signals[index++] = (int8_t) (channels[
i] & 0xFF);
204 rc_signals[index++] = (int8_t) ((channels[
i] >> 8) & 0xFF);
215 std::vector<int8_t>rc_signals(16);
217 int droneNumber = channels[8];
218 for (
int i = 0;
i < 8;
i++) {
220 rc_signals[index++] = (int8_t) (channels[
i] & 0xFF);
221 rc_signals[index++] = (int8_t) ((channels[
i] >> 8) & 0xFF);
232 std::vector<int8_t>posData(8);
234 for (
int i = 0;
i < 4;
i++) {
236 posData[index++] = (int8_t) (posArray[
i] & 0xFF);
237 posData[index++] = (int8_t) ((posArray[
i] >> 8) & 0xFF);
248 for (
size_t i = 0;
i < requests.size();
i++) {
257 for (
size_t i = 0;
i < requests.size();
i++) {
static const int MSP_ATTITUDE
void sendMulRequestMSP_SET_RAW_RC(int channels[])
static const int MSP_FC_VERSION
void sendRequestMSP(std::vector< int8_t > data)
static const int MSP_SET_POS
void sendRequestMSP_GET_DEBUG(std::vector< int > requests)
int writeMulSock(const void *buf, int count, int i)
static const int MSP_ALTITUDE
static const int MSP_ACC_TRIM
int writeSock(const void *buf, int count)
void evaluateCommand(int command)
void sendMulRequestMSP_GET_DEBUG(std::vector< int > requests, int index)
std::vector< int8_t > createPacketMSP(int msp, std::vector< int8_t >payload)
void sendRequestMSP_SET_POS(int posArray[])
static const int MSP_ANALOG
void sendMulRequestMSP(std::vector< int8_t > data, int i)
static const int MSP_SET_RAW_RC
static const int MSP_RAW_IMU
void sendRequestMSP_SET_RAW_RC(int channels[])