1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

First cut of MSP using streambuf

This commit is contained in:
Martin Budden 2016-10-16 14:57:37 +01:00
parent 9b83af1ccd
commit b62afbefd8
4 changed files with 633 additions and 772 deletions

View file

@ -17,6 +17,8 @@
#pragma once
#include "common/streambuf.h"
// return positive for ACK, negative on error, zero for no reply
typedef enum {
MSP_RESULT_ACK = 1,
@ -24,8 +26,12 @@ typedef enum {
MSP_RESULT_NO_REPLY = 0
} mspResult_e;
typedef struct mspPacket_s {
sbuf_t buf;
int16_t cmd;
int16_t result;
} mspPacket_t;
struct serialPort_s;
typedef void (*mspPostProcessFnPtr)(struct serialPort_s *port); // msp post process function, used for gracefully handling reboots, etc.
struct mspPort_s;
typedef mspResult_e (*mspProcessCommandFnPtr)(struct mspPort_s *mspPort, mspPostProcessFnPtr *mspPostProcessFn);
typedef mspResult_e (*mspProcessCommandFnPtr)(mspPacket_t *cmd, mspPacket_t *reply, mspPostProcessFnPtr *mspPostProcessFn);