You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.2 KiB

/*
* bsp_desulfurizer_handler.c
*
* Created on: Jul 29, 2024
* Author: akeguo
*/
#include "pb_decode.h"
#include "pb_encode.h"
#include "bsp_include.h"
#include "pb.h"
#include "bsp_Cmd.pb.h"
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include "BHBF_ROBOT.h"
#include "bsp_cpu_flash.h"
#include <bsp_qspi_w25q128.h>
#include <bsp_UpperComputer_Handler.h>
#include "bsp_decode_command.h"
void decode_command_from_computer(uint8_t *buffer, uint16_t length);
struct UARTHandler *desulfurizer_message_UART_Handler;
void upper_Computer_UART_Handler_intialize(struct UARTHandler *Handler)
{
//LOG("desulfurizer_message_UART_Handler_intialize");
desulfurizer_message_UART_Handler = Handler;
desulfurizer_message_UART_Handler->UART_Decode =
decode_command_from_computer; //indicate that there is no need to listen
//desulfurizer_message_UART_Handler->DispacherCallPeriod=200;
//desulfurizer_message_UART_Handler->Add_Dispatcher_List(desulfurizer_message_UART_Handler,steering_set_angle);
}
void decode_command_from_computer(uint8_t *buffer, uint16_t length)
{
if(*buffer==0x55 && *(buffer+1)==0x55 && length>=3)
{
decode_command_and_feedback(buffer+2, length-2, 0,
desulfurizer_message_UART_Handler);//0代表非mqtt
}
}