1 /*
2  * Copyright (c) 2021 Nordic Semiconductor
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 #include <string.h>
7 #include <zephyr/logging/log_link.h>
8 
initiate(const struct log_link * link,struct log_link_config * configa)9 static int initiate(const struct log_link *link, struct log_link_config *configa)
10 {
11 	link->ctrl_blk->domain_cnt = 1;
12 	link->ctrl_blk->source_cnt[0] = 1;
13 
14 	return 0;
15 }
16 
activate(const struct log_link * link)17 static int activate(const struct log_link *link)
18 {
19 	return 0;
20 }
21 
get_domain_name(const struct log_link * link,uint32_t domain_id,char * buf,size_t * length)22 static int get_domain_name(const struct log_link *link, uint32_t domain_id,
23 			char *buf, size_t *length)
24 {
25 	if (length) {
26 		*length = 0;
27 	}
28 	return 0;
29 }
30 
get_source_name(const struct log_link * link,uint32_t domain_id,uint16_t source_id,char * buf,size_t * length)31 static int get_source_name(const struct log_link *link, uint32_t domain_id,
32 			uint16_t source_id, char *buf, size_t *length)
33 {
34 	if (length) {
35 		*length = 0;
36 	}
37 
38 	return 0;
39 }
40 
get_levels(const struct log_link * link,uint32_t domain_id,uint16_t source_id,uint8_t * level,uint8_t * runtime_level)41 static int get_levels(const struct log_link *link, uint32_t domain_id,
42 			uint16_t source_id, uint8_t *level, uint8_t *runtime_level)
43 {
44 	if (level) {
45 		*level = LOG_LEVEL_INF;
46 	}
47 	if (runtime_level) {
48 		*runtime_level = LOG_LEVEL_INF;
49 	}
50 
51 	return 0;
52 }
53 
set_runtime_level(const struct log_link * link,uint32_t domain_id,uint16_t source_id,uint8_t level)54 static int set_runtime_level(const struct log_link *link, uint32_t domain_id,
55 				uint16_t source_id, uint8_t level)
56 {
57 	return 0;
58 }
59 
60 struct log_link_api mock_log_link_api = {
61 	.initiate = initiate,
62 	.activate = activate,
63 	.get_domain_name = get_domain_name,
64 	.get_source_name = get_source_name,
65 	.get_levels = get_levels,
66 	.set_runtime_level = set_runtime_level,
67 };
68