目录
1 安装Python和Cantools
1.1 查看Python已安装的Package包
1.2 在Python中安装Cantools插件包
1.3 获取更多Cantools工具的更新动态
2 CAN Matrix Arxml自动生成C语言代码
2.1 批处理文件CAN_Matrix_Arxml_To_C.bat内容说明
2.2 CAN Matrix Arxml文件要求
2.3 如何使用生成的C语言代码
3 附录:CAN Matrix Arxml文件
4 附录:生成的power_train.c文件
5 附录:生成的power_train.h文件
结尾
优质博文推荐阅读(单击下方链接,即可跳转):
Vector工具链
CAN Matrix DBC
CAN Matrix Arxml
【DBC专题】-11-使用Cantools将CAN/CANFD DBC自动生成C语言代码
1 安装Python和Cantools
在Python Releases for Windows | Python.org链接中,找到你需要的Python版本(建议使用3.7及以上版本)下载,并安装。
1.1 查看Python已安装的Package包
快捷键Win + R,打开运行对话框,在其中输入CMD,单击确定。
在弹出的“Windows 命令提示符”窗口,输入命令pip list,可以查看Python已安装的包,及其版本。
1.2 在Python中安装Cantools插件包
在弹出的“Windows 命令提示符”窗口,输入命令pip install cantools,安装Cantools插件包。
Cantools成功安装后提示:
Successfully installed argparse-addons-0.12.0 bitstruct-8.19.0 cantools-39.4.5 crccheck-1.3.0 diskcache-5.6.3 packaging-24.0 python-can-4.3.1 pywin32-306 textparser-0.24.0 typing-extensions-4.10.0 wrapt-1.16.0
使用命令pip list,可以获取Cantools的版本。
1.3 获取更多Cantools工具的更新动态
在GitHub - cantools/cantools: CAN bus tools.链接中,可以关注Cantools该插件最新的更新动态。
2 CAN Matrix Arxml自动生成C语言代码
双击运行批处理文件CAN_Matrix_Arxml_To_C.bat,自动生成两个power_train.c和power_train.h,将这两个文件添加到你的编译环境中,并调用生成的API接口即可。
2.1 批处理文件CAN_Matrix_Arxml_To_C.bat内容说明
CAN_Matrix_Arxml_To_C.bat内容摘录如下,使用该批处理文件需要注意以下四点:
CAN Matrix Arxml文件与批处理文件在同一个目录下;CAN Matrix Arxml文件不能数字,或特殊字符开头,否则生成的代码,不符合C语言语法;使用文本编辑工具,打开批处理文件,将PowerTrain替换成同目录下的Arxml文件名称;使用文本编辑工具,打开批处理文件,将Gateway替换成Arxml中你所使用的发送节点名称。
@echo off
::切换至当前目录
cd.
::CAN Matrix Arxml自动生成C语言代码
python -m cantools generate_c_source -e "gb18030" PowerTrain.arxml --node Gateway
2.2 CAN Matrix Arxml文件要求
这个很重要,决定了能否生成C代码文件,以及生成C代码文件的质量。
以使用的PowerTrain.arxml为例,该批处理文件自动生成的是节点Gateway所收/发的帧和信号的C语言代码。故没有在Tx Frames,Rx Frames出现的帧和信号,不会生成代码。
小结:
在编辑Message和Signal时,需要明确该帧的“发送节点”,以及帧内信号的“接收节点”;并不是所有的CAN Matrix Arxml都可以生成C语言代码,原因是XML的格式(属性标签,分支嵌套结构…)是多变的,Cantools工具无法识别各种Arxml变异,请使用专业工具生成的Arxml文件(AUTOSAR System Description Network Explorer生成的arxml文件有时都无法生成C文件),如PREEvision
如何准确的制作一个Arxml文件,参考博文【ARXML专题】-2-创建一个Classic CAN(经典CAN2.0)/CANFD的系统描述ARXML文件_新建arxml指令-CSDN博客https://blog.csdn.net/qfmzhu/article/details/111936806
2.3 如何使用生成的C语言代码
API接口****_pack(例如power_train_diag_request_motor_pack)表示将本节点发送的信号的结构体(传参const struct power_train_diag_request_motor_t *src_p)拼接/打包成“字节数组”;
API接口****_unpack (例如power_train_gear_box_info_unpack) 表示将本节点接收的信号的结构体(传参struct power_train_gear_box_info_t *dst_p,),由“字节数组”进行解包得到。
3 附录:CAN Matrix Arxml文件
4 附录:生成的power_train.c文件
/**
* The MIT License (MIT)
*
* Copyright (c) 2018-2019 Erik Moqvist
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* This file was generated by cantools version 39.4.5 Thu Mar 21 22:29:24 2024.
*/
#include
#include "power_train.h"
static inline uint8_t pack_left_shift_u8(
uint8_t value,
uint8_t shift,
uint8_t mask)
{
return (uint8_t)((uint8_t)(value << shift) & mask);
}
static inline uint8_t pack_left_shift_u16(
uint16_t value,
uint8_t shift,
uint8_t mask)
{
return (uint8_t)((uint8_t)(value << shift) & mask);
}
static inline uint8_t pack_left_shift_u32(
uint32_t value,
uint8_t shift,
uint8_t mask)
{
return (uint8_t)((uint8_t)(value << shift) & mask);
}
static inline uint8_t pack_left_shift_u64(
uint64_t value,
uint8_t shift,
uint8_t mask)
{
return (uint8_t)((uint8_t)(value << shift) & mask);
}
static inline uint8_t pack_right_shift_u16(
uint16_t value,
uint8_t shift,
uint8_t mask)
{
return (uint8_t)((uint8_t)(value >> shift) & mask);
}
static inline uint8_t pack_right_shift_u32(
uint32_t value,
uint8_t shift,
uint8_t mask)
{
return (uint8_t)((uint8_t)(value >> shift) & mask);
}
static inline uint8_t pack_right_shift_u64(
uint64_t value,
uint8_t shift,
uint8_t mask)
{
return (uint8_t)((uint8_t)(value >> shift) & mask);
}
static inline uint8_t unpack_right_shift_u8(
uint8_t value,
uint8_t shift,
uint8_t mask)
{
return (uint8_t)((uint8_t)(value & mask) >> shift);
}
int power_train_ab_sdata_init(struct power_train_ab_sdata_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_ab_sdata_t));
msg_p->acceleration_force = 0;
return 0;
}
int power_train_diag_request_init(struct power_train_diag_request_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_diag_request_t));
return 0;
}
int power_train_diag_response_init(struct power_train_diag_response_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_diag_response_t));
return 0;
}
int power_train_diag_request_motor_pack(
uint8_t *dst_p,
const struct power_train_diag_request_motor_t *src_p,
size_t size)
{
if (size < 8u) {
return (-EINVAL);
}
memset(&dst_p[0], 0, 8);
dst_p[0] |= pack_left_shift_u64(src_p->diag_request, 0u, 0xffu);
dst_p[1] |= pack_right_shift_u64(src_p->diag_request, 8u, 0xffu);
dst_p[2] |= pack_right_shift_u64(src_p->diag_request, 16u, 0xffu);
dst_p[3] |= pack_right_shift_u64(src_p->diag_request, 24u, 0xffu);
dst_p[4] |= pack_right_shift_u64(src_p->diag_request, 32u, 0xffu);
dst_p[5] |= pack_right_shift_u64(src_p->diag_request, 40u, 0xffu);
dst_p[6] |= pack_right_shift_u64(src_p->diag_request, 48u, 0xffu);
dst_p[7] |= pack_right_shift_u64(src_p->diag_request, 56u, 0xffu);
return (8);
}
int power_train_diag_request_motor_init(struct power_train_diag_request_motor_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_diag_request_motor_t));
return 0;
}
uint64_t power_train_diag_request_motor_diag_request_encode(double value)
{
return (uint64_t)(value);
}
bool power_train_diag_request_motor_diag_request_is_in_range(uint64_t value)
{
(void)value;
return (true);
}
int power_train_diag_response_motor_init(struct power_train_diag_response_motor_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_diag_response_motor_t));
return 0;
}
int power_train_engine_data_init(struct power_train_engine_data_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_engine_data_t));
return 0;
}
int power_train_engine_data_ieee_init(struct power_train_engine_data_ieee_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_engine_data_ieee_t));
return 0;
}
int power_train_engine_status_init(struct power_train_engine_status_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_engine_status_t));
return 0;
}
int power_train_gear_box_info_unpack(
struct power_train_gear_box_info_t *dst_p,
const uint8_t *src_p,
size_t size)
{
if (size < 1u) {
return (-EINVAL);
}
dst_p->gear = unpack_right_shift_u8(src_p[0], 0u, 0x07u);
dst_p->shift_request = unpack_right_shift_u8(src_p[0], 3u, 0x08u);
dst_p->eco_mode = unpack_right_shift_u8(src_p[0], 6u, 0xc0u);
return (0);
}
int power_train_gear_box_info_init(struct power_train_gear_box_info_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_gear_box_info_t));
return 0;
}
double power_train_gear_box_info_gear_decode(uint8_t value)
{
return ((double)value);
}
bool power_train_gear_box_info_gear_is_in_range(uint8_t value)
{
return (value <= 7u);
}
double power_train_gear_box_info_shift_request_decode(uint8_t value)
{
return ((double)value);
}
bool power_train_gear_box_info_shift_request_is_in_range(uint8_t value)
{
return (value <= 1u);
}
double power_train_gear_box_info_eco_mode_decode(uint8_t value)
{
return ((double)value);
}
bool power_train_gear_box_info_eco_mode_is_in_range(uint8_t value)
{
return (value <= 3u);
}
int power_train_ignition_info_pack(
uint8_t *dst_p,
const struct power_train_ignition_info_t *src_p,
size_t size)
{
if (size < 2u) {
return (-EINVAL);
}
memset(&dst_p[0], 0, 2);
dst_p[0] |= pack_left_shift_u8(src_p->starter_key, 0u, 0x01u);
return (2);
}
int power_train_ignition_info_init(struct power_train_ignition_info_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_ignition_info_t));
return 0;
}
uint8_t power_train_ignition_info_starter_key_encode(double value)
{
return (uint8_t)(value);
}
bool power_train_ignition_info_starter_key_is_in_range(uint8_t value)
{
return (value <= 1u);
}
int power_train_nm_engine_init(struct power_train_nm_engine_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_nm_engine_t));
return 0;
}
int power_train_nm_gateway_power_train_pack(
uint8_t *dst_p,
const struct power_train_nm_gateway_power_train_t *src_p,
size_t size)
{
(void)src_p;
if (size < 4u) {
return (-EINVAL);
}
memset(&dst_p[0], 0, 4);
return (4);
}
int power_train_nm_gateway_power_train_init(struct power_train_nm_gateway_power_train_t *msg_p)
{
if (msg_p == NULL) return -1;
memset(msg_p, 0, sizeof(struct power_train_nm_gateway_power_train_t));
return 0;
}
5 附录:生成的power_train.h文件
/**
* The MIT License (MIT)
*
* Copyright (c) 2018-2019 Erik Moqvist
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* This file was generated by cantools version 39.4.5 Thu Mar 21 22:29:24 2024.
*/
#ifndef POWER_TRAIN_H
#define POWER_TRAIN_H
#ifdef __cplusplus
extern "C" {
#endif
#include
#include
#include
#ifndef EINVAL
# define EINVAL 22
#endif
/* Frame ids. */
#define POWER_TRAIN_DIAG_REQUEST_MOTOR_FRAME_ID (0x601u)
#define POWER_TRAIN_GEAR_BOX_INFO_FRAME_ID (0x3fcu)
#define POWER_TRAIN_IGNITION_INFO_FRAME_ID (0x67u)
#define POWER_TRAIN_NM_GATEWAY_POWER_TRAIN_FRAME_ID (0x51au)
/* Frame lengths in bytes. */
#define POWER_TRAIN_DIAG_REQUEST_MOTOR_LENGTH (8u)
#define POWER_TRAIN_GEAR_BOX_INFO_LENGTH (1u)
#define POWER_TRAIN_IGNITION_INFO_LENGTH (2u)
#define POWER_TRAIN_NM_GATEWAY_POWER_TRAIN_LENGTH (4u)
/* Extended or standard frame types. */
#define POWER_TRAIN_DIAG_REQUEST_MOTOR_IS_EXTENDED (0)
#define POWER_TRAIN_GEAR_BOX_INFO_IS_EXTENDED (0)
#define POWER_TRAIN_IGNITION_INFO_IS_EXTENDED (0)
#define POWER_TRAIN_NM_GATEWAY_POWER_TRAIN_IS_EXTENDED (0)
/* Frame cycle times in milliseconds. */
#define POWER_TRAIN_GEAR_BOX_INFO_CYCLE_TIME_MS (50u)
#define POWER_TRAIN_IGNITION_INFO_CYCLE_TIME_MS (20u)
/* Signal choices. */
/* Frame Names. */
#define POWER_TRAIN_DIAG_REQUEST_MOTOR_NAME "DiagRequest_Motor"
#define POWER_TRAIN_GEAR_BOX_INFO_NAME "GearBoxInfo"
#define POWER_TRAIN_IGNITION_INFO_NAME "Ignition_Info"
#define POWER_TRAIN_NM_GATEWAY_POWER_TRAIN_NAME "NM_Gateway_PowerTrain"
/* Signal Names. */
#define POWER_TRAIN_DIAG_REQUEST_MOTOR_DIAG_REQUEST_NAME "DiagRequest"
#define POWER_TRAIN_GEAR_BOX_INFO_GEAR_NAME "Gear"
#define POWER_TRAIN_GEAR_BOX_INFO_SHIFT_REQUEST_NAME "ShiftRequest"
#define POWER_TRAIN_GEAR_BOX_INFO_ECO_MODE_NAME "EcoMode"
#define POWER_TRAIN_IGNITION_INFO_STARTER_KEY_NAME "StarterKey"
/**
* Signals in message DiagRequest_Motor.
*
* All signal values are as on the CAN bus.
*/
struct power_train_diag_request_motor_t {
/**
* Range: -
* Scale: 1
* Offset: 0
*/
uint64_t diag_request;
};
/**
* Signals in message GearBoxInfo.
*
* All signal values are as on the CAN bus.
*/
struct power_train_gear_box_info_t {
/**
* Range: -
* Scale: 1
* Offset: 0
*/
uint8_t gear;
/**
* Range: -
* Scale: 1
* Offset: 0
*/
uint8_t shift_request;
/**
* Range: -
* Scale: 1
* Offset: 0
*/
uint8_t eco_mode;
};
/**
* Signals in message Ignition_Info.
*
* All signal values are as on the CAN bus.
*/
struct power_train_ignition_info_t {
/**
* Range: -
* Scale: 1
* Offset: 0
*/
uint8_t starter_key;
};
/**
* Signals in message NM_Gateway_PowerTrain.
*
* All signal values are as on the CAN bus.
*/
struct power_train_nm_gateway_power_train_t {
/**
* Dummy signal in empty message.
*/
uint8_t dummy;
};
/**
* Init message fields to default values from ABSdata.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_ab_sdata_init(struct power_train_ab_sdata_t *msg_p);
/**
* Init message fields to default values from Diag_Request.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_diag_request_init(struct power_train_diag_request_t *msg_p);
/**
* Init message fields to default values from Diag_Response.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_diag_response_init(struct power_train_diag_response_t *msg_p);
/**
* Pack message DiagRequest_Motor.
*
* @param[out] dst_p Buffer to pack the message into.
* @param[in] src_p Data to pack.
* @param[in] size Size of dst_p.
*
* @return Size of packed data, or negative error code.
*/
int power_train_diag_request_motor_pack(
uint8_t *dst_p,
const struct power_train_diag_request_motor_t *src_p,
size_t size);
/**
* Init message fields to default values from DiagRequest_Motor.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_diag_request_motor_init(struct power_train_diag_request_motor_t *msg_p);
/**
* Encode given signal by applying scaling and offset.
*
* @param[in] value Signal to encode.
*
* @return Encoded signal.
*/
uint64_t power_train_diag_request_motor_diag_request_encode(double value);
/**
* Check that given signal is in allowed range.
*
* @param[in] value Signal to check.
*
* @return true if in range, false otherwise.
*/
bool power_train_diag_request_motor_diag_request_is_in_range(uint64_t value);
/**
* Init message fields to default values from DiagResponse_Motor.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_diag_response_motor_init(struct power_train_diag_response_motor_t *msg_p);
/**
* Init message fields to default values from EngineData.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_engine_data_init(struct power_train_engine_data_t *msg_p);
/**
* Init message fields to default values from EngineDataIEEE.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_engine_data_ieee_init(struct power_train_engine_data_ieee_t *msg_p);
/**
* Init message fields to default values from EngineStatus.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_engine_status_init(struct power_train_engine_status_t *msg_p);
/**
* Unpack message GearBoxInfo.
*
* @param[out] dst_p Object to unpack the message into.
* @param[in] src_p Message to unpack.
* @param[in] size Size of src_p.
*
* @return zero(0) or negative error code.
*/
int power_train_gear_box_info_unpack(
struct power_train_gear_box_info_t *dst_p,
const uint8_t *src_p,
size_t size);
/**
* Init message fields to default values from GearBoxInfo.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_gear_box_info_init(struct power_train_gear_box_info_t *msg_p);
/**
* Decode given signal by applying scaling and offset.
*
* @param[in] value Signal to decode.
*
* @return Decoded signal.
*/
double power_train_gear_box_info_gear_decode(uint8_t value);
/**
* Check that given signal is in allowed range.
*
* @param[in] value Signal to check.
*
* @return true if in range, false otherwise.
*/
bool power_train_gear_box_info_gear_is_in_range(uint8_t value);
/**
* Decode given signal by applying scaling and offset.
*
* @param[in] value Signal to decode.
*
* @return Decoded signal.
*/
double power_train_gear_box_info_shift_request_decode(uint8_t value);
/**
* Check that given signal is in allowed range.
*
* @param[in] value Signal to check.
*
* @return true if in range, false otherwise.
*/
bool power_train_gear_box_info_shift_request_is_in_range(uint8_t value);
/**
* Decode given signal by applying scaling and offset.
*
* @param[in] value Signal to decode.
*
* @return Decoded signal.
*/
double power_train_gear_box_info_eco_mode_decode(uint8_t value);
/**
* Check that given signal is in allowed range.
*
* @param[in] value Signal to check.
*
* @return true if in range, false otherwise.
*/
bool power_train_gear_box_info_eco_mode_is_in_range(uint8_t value);
/**
* Pack message Ignition_Info.
*
* @param[out] dst_p Buffer to pack the message into.
* @param[in] src_p Data to pack.
* @param[in] size Size of dst_p.
*
* @return Size of packed data, or negative error code.
*/
int power_train_ignition_info_pack(
uint8_t *dst_p,
const struct power_train_ignition_info_t *src_p,
size_t size);
/**
* Init message fields to default values from Ignition_Info.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_ignition_info_init(struct power_train_ignition_info_t *msg_p);
/**
* Encode given signal by applying scaling and offset.
*
* @param[in] value Signal to encode.
*
* @return Encoded signal.
*/
uint8_t power_train_ignition_info_starter_key_encode(double value);
/**
* Check that given signal is in allowed range.
*
* @param[in] value Signal to check.
*
* @return true if in range, false otherwise.
*/
bool power_train_ignition_info_starter_key_is_in_range(uint8_t value);
/**
* Init message fields to default values from NM_Engine.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_nm_engine_init(struct power_train_nm_engine_t *msg_p);
/**
* Pack message NM_Gateway_PowerTrain.
*
* @param[out] dst_p Buffer to pack the message into.
* @param[in] src_p Data to pack.
* @param[in] size Size of dst_p.
*
* @return Size of packed data, or negative error code.
*/
int power_train_nm_gateway_power_train_pack(
uint8_t *dst_p,
const struct power_train_nm_gateway_power_train_t *src_p,
size_t size);
/**
* Init message fields to default values from NM_Gateway_PowerTrain.
*
* @param[in] msg_p Message to init.
*
* @return zero(0) on success or (-1) in case of nullptr argument.
*/
int power_train_nm_gateway_power_train_init(struct power_train_nm_gateway_power_train_t *msg_p);
#ifdef __cplusplus
}
#endif
#endif
结尾
获取更多“汽车电子资讯”和“工具链使用”,
请关注CSDN博客“汽车电子助手”,做您的好助手。
精彩文章
发表评论