Skip to content

Instantly share code, notes, and snippets.

@ahappyforest
Created December 23, 2013 07:15
Show Gist options
  • Save ahappyforest/8092882 to your computer and use it in GitHub Desktop.
Save ahappyforest/8092882 to your computer and use it in GitHub Desktop.
这是蘑菇项目的message定义
#ifndef __MESSAGE__H__
#define __MESSAGE__H__
#include <inttypes.h>
const static char HEADER[] = "MUSHROOM";
const static char END = 0x13;
struct message_s {
char header[sizeof(HEADER)];
int32_t pb_len; // 4 bytes
int32_t pb_type; // 4 bytes
void *pb_data;
int32_t crc; // 4 bytes
char end;
};
typedef struct message_s message_t;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment