#ifndef CAN_DEBUG_H
#define CAN_DEBUG_H

#include "stdint.h"
#include "rkfifo.h"
#include "soft_can.h"

#define MAX_ID_NUM 40
extern rkfifo_t candebug_rkfifo;

typedef struct 
{
    uint32_t ID;
    uint8_t len;
    uint8_t connect_status;
    uint8_t send_fre;
    uint8_t data[8];
    uint32_t ID_time;
}Debug_ID_data;

typedef struct 
{
    Debug_ID_data ID_buf[MAX_ID_NUM];
    uint16_t Total_Dev_num; //总设备数
    bool Open_flag;
    int (*Len)(uint8_t i);
}Debug_buf;
extern Debug_buf debug_can;

void seek_can_debug_buf_adr(void);
void Can_send_debug_to_app(void);
void put_candata_to_rkfifo_rx(CAN_RxHeaderTypeDef rxhead,uint8_t *data);
void put_candata_to_rkfifo_tx(CAN_TxHeaderTypeDef txhead,uint8_t *data);
void check_can_dev_connect(void);
int get_data_total_len(uint8_t i);

#endif 