1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef CAN_CLIENT_H
10 #define CAN_CLIENT_H
11 
12 #include "can_core.h"
13 #include "can_mail.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
18 
19 struct CanClient;
20 
21 int32_t CanClientCreateByNumber(int32_t busNum, struct CanClient **client);
22 
23 void CanClientDestroy(struct CanClient *client);
24 
25 int32_t CanClientWriteMsg(struct CanClient *client, const struct CanMsg *msg);
26 
27 int32_t CanClientReadMsg(struct CanClient *client, struct CanMsg *msg, uint32_t tms);
28 
29 int32_t CanClientAddFilter(struct CanClient *client, const struct CanFilter *filter);
30 
31 int32_t CanClientDelFilter(struct CanClient *client, const struct CanFilter *filter);
32 
33 int32_t CanClientSetCfg(struct CanClient *client, const struct CanConfig *cfg);
34 
35 int32_t CanClientGetCfg(struct CanClient *client, struct CanConfig *cfg);
36 
37 int32_t CanClientGetState(struct CanClient *client);
38 
39 #ifdef __cplusplus
40 }
41 #endif /* __cplusplus */
42 
43 #endif
44