Nanopb (lightweight version of googles protobuf) test. It is not working as it should yet.

Dependencies:   MODSERIAL mbed

Committer:
Tomas
Date:
Wed Apr 09 11:44:14 2014 +0000
Revision:
3:fd0e1bc80f78
Parent:
0:bada2c7bd577
removed unnecessary libraries

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Tomas 0:bada2c7bd577 1 /* Automatically generated nanopb header */
Tomas 0:bada2c7bd577 2 /* Generated by nanopb-0.2.5 at Wed Feb 05 22:39:14 2014. */
Tomas 0:bada2c7bd577 3
Tomas 0:bada2c7bd577 4 #ifndef _PB_THREEAXIS_PB_H_
Tomas 0:bada2c7bd577 5 #define _PB_THREEAXIS_PB_H_
Tomas 0:bada2c7bd577 6 #include <pb.h>
Tomas 0:bada2c7bd577 7
Tomas 0:bada2c7bd577 8 #ifdef __cplusplus
Tomas 0:bada2c7bd577 9 extern "C" {
Tomas 0:bada2c7bd577 10 #endif
Tomas 0:bada2c7bd577 11
Tomas 0:bada2c7bd577 12 /* Enum definitions */
Tomas 0:bada2c7bd577 13 /* Struct definitions */
Tomas 0:bada2c7bd577 14 typedef struct _acc_message {
Tomas 0:bada2c7bd577 15 float X;
Tomas 0:bada2c7bd577 16 float Y;
Tomas 0:bada2c7bd577 17 float Z;
Tomas 0:bada2c7bd577 18 } acc_message;
Tomas 0:bada2c7bd577 19
Tomas 0:bada2c7bd577 20 typedef struct _gyro_message {
Tomas 0:bada2c7bd577 21 float X;
Tomas 0:bada2c7bd577 22 float Y;
Tomas 0:bada2c7bd577 23 float Z;
Tomas 0:bada2c7bd577 24 } gyro_message;
Tomas 0:bada2c7bd577 25
Tomas 0:bada2c7bd577 26 typedef struct _imu_message {
Tomas 0:bada2c7bd577 27 float X;
Tomas 0:bada2c7bd577 28 float Y;
Tomas 0:bada2c7bd577 29 float Z;
Tomas 0:bada2c7bd577 30 } imu_message;
Tomas 0:bada2c7bd577 31
Tomas 0:bada2c7bd577 32 typedef struct _motor_message {
Tomas 0:bada2c7bd577 33 int32_t m1;
Tomas 0:bada2c7bd577 34 int32_t m2;
Tomas 0:bada2c7bd577 35 int32_t m3;
Tomas 0:bada2c7bd577 36 int32_t m4;
Tomas 0:bada2c7bd577 37 int32_t m5;
Tomas 0:bada2c7bd577 38 int32_t m6;
Tomas 0:bada2c7bd577 39 } motor_message;
Tomas 0:bada2c7bd577 40
Tomas 0:bada2c7bd577 41 typedef struct _status_message {
Tomas 0:bada2c7bd577 42 float BatteryLevel;
Tomas 0:bada2c7bd577 43 int32_t Frequency;
Tomas 0:bada2c7bd577 44 int32_t Mode;
Tomas 0:bada2c7bd577 45 } status_message;
Tomas 0:bada2c7bd577 46
Tomas 0:bada2c7bd577 47 /* Default values for struct fields */
Tomas 0:bada2c7bd577 48
Tomas 0:bada2c7bd577 49 /* Field tags (for use in manual encoding/decoding) */
Tomas 0:bada2c7bd577 50 #define acc_message_X_tag 1
Tomas 0:bada2c7bd577 51 #define acc_message_Y_tag 2
Tomas 0:bada2c7bd577 52 #define acc_message_Z_tag 3
Tomas 0:bada2c7bd577 53 #define gyro_message_X_tag 1
Tomas 0:bada2c7bd577 54 #define gyro_message_Y_tag 2
Tomas 0:bada2c7bd577 55 #define gyro_message_Z_tag 3
Tomas 0:bada2c7bd577 56 #define imu_message_X_tag 1
Tomas 0:bada2c7bd577 57 #define imu_message_Y_tag 2
Tomas 0:bada2c7bd577 58 #define imu_message_Z_tag 3
Tomas 0:bada2c7bd577 59 #define motor_message_m1_tag 1
Tomas 0:bada2c7bd577 60 #define motor_message_m2_tag 2
Tomas 0:bada2c7bd577 61 #define motor_message_m3_tag 3
Tomas 0:bada2c7bd577 62 #define motor_message_m4_tag 4
Tomas 0:bada2c7bd577 63 #define motor_message_m5_tag 5
Tomas 0:bada2c7bd577 64 #define motor_message_m6_tag 6
Tomas 0:bada2c7bd577 65 #define status_message_BatteryLevel_tag 1
Tomas 0:bada2c7bd577 66 #define status_message_Frequency_tag 2
Tomas 0:bada2c7bd577 67 #define status_message_Mode_tag 3
Tomas 0:bada2c7bd577 68
Tomas 0:bada2c7bd577 69 /* Struct field encoding specification for nanopb */
Tomas 0:bada2c7bd577 70 extern const pb_field_t status_message_fields[4];
Tomas 0:bada2c7bd577 71 extern const pb_field_t imu_message_fields[4];
Tomas 0:bada2c7bd577 72 extern const pb_field_t gyro_message_fields[4];
Tomas 0:bada2c7bd577 73 extern const pb_field_t acc_message_fields[4];
Tomas 0:bada2c7bd577 74 extern const pb_field_t motor_message_fields[7];
Tomas 0:bada2c7bd577 75
Tomas 0:bada2c7bd577 76 /* Maximum encoded size of messages (where known) */
Tomas 0:bada2c7bd577 77 #define status_message_size 27
Tomas 0:bada2c7bd577 78 #define imu_message_size 15
Tomas 0:bada2c7bd577 79 #define gyro_message_size 15
Tomas 0:bada2c7bd577 80 #define acc_message_size 15
Tomas 0:bada2c7bd577 81 #define motor_message_size 66
Tomas 0:bada2c7bd577 82
Tomas 0:bada2c7bd577 83 #ifdef __cplusplus
Tomas 0:bada2c7bd577 84 } /* extern "C" */
Tomas 0:bada2c7bd577 85 #endif
Tomas 0:bada2c7bd577 86
Tomas 0:bada2c7bd577 87 #endif
Tomas 0:bada2c7bd577 88