/*
 * bsp_pb_decode_encode.h
 *
 *  Created on: Jul 5, 2024
 *      Author: akeguo
 */

#ifndef INC_BSP_BSP_PB_DECODE_ENCODE_H_
#define INC_BSP_BSP_PB_DECODE_ENCODE_H_

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>

#include "pb_decode.h"
#include "pb_encode.h"
#include "pb.h"
#include "bsp_CV.pb.h"
#include "bsp_GV.pb.h"
#include "msp_MK32.pb.h"
#include "msp_Motor.pb.h"
#include "bsp_PV.pb.h"
#include "bsp_CV.pb.h"
#include "bsp_CV.pb.h"
#include "pb_common.h"
#include "bsp_Trace.pb.h"
#include "bsp_IAP.pb.h"
IAP_struct_define pb_decode_IAP(uint8_t *buf, size_t length);

typedef struct pb_buffer_arg
{
  /* Buffer to be written, or reference to read buffer */
  void const *buf;
  /* Length of buf */
  size_t buf_len;
} pb_buffer_arg;


 bool pb_encode_string_cb(pb_ostream_t *stream, const pb_field_t *field,    void *const *arg);
 bool pb_decode_string_cb(pb_istream_t *stream, const pb_field_t *field,    void **arg);


extern CV_struct_define pb_decode_CV(char *buf, size_t length);
extern void Test_CV();

//extern void pb_encode_TraceMessage(char buf[], size_t buf_len,size_t* len,TraceLevel traceLevel, char logger[], char message[] );
void pb_encode_TraceMessage(char buf[],size_t buf_len, size_t* len,
		char traceLevel[], char logger[], char message[] );

#endif /* INC_BSP_BSP_PB_DECODE_ENCODE_H_ */
