1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

UAVTalk: Update protcol version number to go with new packet format and changed

a few constants to make it self documenting

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2017 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2010-10-27 17:41:41 +00:00 committed by peabody124
parent 4570d6df23
commit aada18a0ea
2 changed files with 4 additions and 4 deletions

View File

@ -34,13 +34,13 @@
// Private constants
#define SYNC_VAL 0x3C
#define TYPE_MASK 0xFC
#define TYPE_VER 0x10
#define TYPE_VER 0x20
#define TYPE_OBJ (TYPE_VER | 0x00)
#define TYPE_OBJ_REQ (TYPE_VER | 0x01)
#define TYPE_OBJ_ACK (TYPE_VER | 0x02)
#define TYPE_ACK (TYPE_VER | 0x03)
#define HEADER_LENGTH 7 // type (1), object ID (4), instance ID (2, not used in single objects)
#define HEADER_LENGTH 10 // sync(1), type (1), size (2), object ID (4), instance ID (2, not used in single objects)
#define CHECKSUM_LENGTH 1
#define MAX_PAYLOAD_LENGTH 256
#define MAX_PACKET_LENGTH (HEADER_LENGTH+MAX_PAYLOAD_LENGTH+CHECKSUM_LENGTH)

View File

@ -67,12 +67,12 @@ private slots:
private:
// Constants
static const int TYPE_MASK = 0xFC;
static const int TYPE_VER = 0x10;
static const int TYPE_VER = 0x20;
static const int TYPE_OBJ = (TYPE_VER | 0x00);
static const int TYPE_OBJ_REQ = (TYPE_VER | 0x01);
static const int TYPE_OBJ_ACK = (TYPE_VER | 0x02);
static const int TYPE_ACK = (TYPE_VER | 0x03);
static const int HEADER_LENGTH = 7; // type (1), object ID (4), instance ID (2, not used in single objects)
static const int HEADER_LENGTH = 10; // sync(1), type (1), size(2), object ID (4), instance ID (2, not used in single objects)
static const int CHECKSUM_LENGTH = 1;
static const int MAX_PAYLOAD_LENGTH = 256;
static const int MAX_PACKET_LENGTH = (HEADER_LENGTH+MAX_PAYLOAD_LENGTH+CHECKSUM_LENGTH);