mirror of
https://github.com/westonrobot/ugv_sdk
synced 2023-04-08 06:32:14 +08:00
fixed scout_base decoding
This commit is contained in:
41
src/protocol_v2/agilex_msg_parser.h
Normal file
41
src/protocol_v2/agilex_msg_parser.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* agilex_msg_parser.h
|
||||
*
|
||||
* Created on: Dec 22, 2020 17:11
|
||||
* Description: public API to encode/decode protocol messages
|
||||
*
|
||||
* Copyright (c) 2020 Ruixiang Du (rdu)
|
||||
*/
|
||||
|
||||
#ifndef AGILEX_MSG_PARSER_H
|
||||
#define AGILEX_MSG_PARSER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __linux__
|
||||
#include <linux/can.h>
|
||||
#else
|
||||
struct can_frame {
|
||||
uint32_t can_id;
|
||||
uint8_t can_dlc;
|
||||
uint8_t data[8] __attribute__((aligned(8)));
|
||||
};
|
||||
#endif
|
||||
|
||||
#include "ugv_sdk/details/interface/agilex_message.h"
|
||||
|
||||
bool DecodeCanFrame(const struct can_frame *rx_frame, AgxMessage *msg);
|
||||
void EncodeCanFrame(const AgxMessage *msg, struct can_frame *tx_frame);
|
||||
uint8_t CalcCanFrameChecksum(uint16_t id, uint8_t *data, uint8_t dlc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AGILEX_MSG_PARSER_H */
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "agx_protocol_v2.h"
|
||||
#include "ugv_sdk/details/protocol_v2/agilex_msg_parser.h"
|
||||
#include "protocol_v2/agilex_msg_parser.h"
|
||||
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
* Copyright (c) 2021 Weston Robot Pte. Ltd.
|
||||
*/
|
||||
|
||||
#include "ugv_sdk/details/protocol_v2/agilex_msg_parser.h"
|
||||
#include "ugv_sdk/details/protocol_v2/protocol_v2_parser.hpp"
|
||||
#include "protocol_v2/agilex_msg_parser.h"
|
||||
|
||||
namespace westonrobot {
|
||||
bool ProtocolV2Parser::DecodeMessage(const struct can_frame *rx_frame,
|
||||
|
||||
Reference in New Issue
Block a user