Zephyr API Documentation
4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 Vogl Electronic GmbH
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
19
#ifndef ZEPHYR_INCLUDE_MGMT_HAWKBIT_CONFIG_H_
20
#define ZEPHYR_INCLUDE_MGMT_HAWKBIT_CONFIG_H_
21
22
#include <
stdint.h
>
23
#include <
zephyr/net/tls_credentials.h
>
24
31
struct
hawkbit_runtime_config
{
33
char
*
server_addr
;
35
uint16_t
server_port
;
37
char
*
auth_token
;
39
sec_tag_t
tls_tag
;
40
};
41
49
int
hawkbit_set_config
(
struct
hawkbit_runtime_config
*config);
50
56
struct
hawkbit_runtime_config
hawkbit_get_config
(void);
57
65
static
inline
int
hawkbit_set_server_addr
(
char
*addr_str)
66
{
67
struct
hawkbit_runtime_config
set_config = {
68
.server_addr = addr_str,
69
.server_port = 0,
70
.auth_token =
NULL
,
71
.tls_tag = 0,
72
};
73
74
return
hawkbit_set_config
(&set_config);
75
}
76
84
static
inline
int
hawkbit_set_server_port
(
uint16_t
port)
85
{
86
struct
hawkbit_runtime_config
set_config = {
87
.server_addr =
NULL
,
88
.server_port = port,
89
.auth_token =
NULL
,
90
.tls_tag = 0,
91
};
92
93
return
hawkbit_set_config
(&set_config);
94
}
95
103
static
inline
int
hawkbit_set_ddi_security_token
(
char
*token)
104
{
105
struct
hawkbit_runtime_config
set_config = {
106
.server_addr =
NULL
,
107
.server_port = 0,
108
.auth_token = token,
109
.tls_tag = 0,
110
};
111
112
return
hawkbit_set_config
(&set_config);
113
}
114
122
static
inline
int
hawkbit_set_tls_tag
(
sec_tag_t
tag
)
123
{
124
struct
hawkbit_runtime_config
set_config = {
125
.server_addr =
NULL
,
126
.server_port = 0,
127
.auth_token =
NULL
,
128
.tls_tag =
tag
,
129
};
130
131
return
hawkbit_set_config
(&set_config);
132
}
133
139
static
inline
char
*
hawkbit_get_server_addr
(
void
)
140
{
141
return
hawkbit_get_config
().
server_addr
;
142
}
143
149
static
inline
uint16_t
hawkbit_get_server_port
(
void
)
150
{
151
return
hawkbit_get_config
().
server_port
;
152
}
153
159
static
inline
char
*
hawkbit_get_ddi_security_token
(
void
)
160
{
161
return
hawkbit_get_config
().
auth_token
;
162
}
163
169
static
inline
sec_tag_t
hawkbit_get_tls_tag
(
void
)
170
{
171
return
hawkbit_get_config
().
tls_tag
;
172
}
173
179
int32_t
hawkbit_get_action_id
(
void
);
180
186
uint32_t
hawkbit_get_poll_interval
(
void
);
187
192
#endif
/* ZEPHYR_INCLUDE_MGMT_HAWKBIT_CONFIG_H_ */
hawkbit_get_action_id
int32_t hawkbit_get_action_id(void)
Get the hawkBit action id.
hawkbit_get_server_port
static uint16_t hawkbit_get_server_port(void)
Get the hawkBit server port.
Definition
config.h:149
hawkbit_get_poll_interval
uint32_t hawkbit_get_poll_interval(void)
Get the hawkBit poll interval.
hawkbit_set_tls_tag
static int hawkbit_set_tls_tag(sec_tag_t tag)
Set the hawkBit TLS tag.
Definition
config.h:122
hawkbit_set_config
int hawkbit_set_config(struct hawkbit_runtime_config *config)
Set the hawkBit server configuration settings.
hawkbit_get_tls_tag
static sec_tag_t hawkbit_get_tls_tag(void)
Get the hawkBit TLS tag.
Definition
config.h:169
hawkbit_set_server_port
static int hawkbit_set_server_port(uint16_t port)
Set the hawkBit server port.
Definition
config.h:84
hawkbit_set_ddi_security_token
static int hawkbit_set_ddi_security_token(char *token)
Set the hawkBit security token.
Definition
config.h:103
hawkbit_set_server_addr
static int hawkbit_set_server_addr(char *addr_str)
Set the hawkBit server address.
Definition
config.h:65
hawkbit_get_config
struct hawkbit_runtime_config hawkbit_get_config(void)
Get the hawkBit server configuration settings.
hawkbit_get_server_addr
static char * hawkbit_get_server_addr(void)
Get the hawkBit server address.
Definition
config.h:139
hawkbit_get_ddi_security_token
static char * hawkbit_get_ddi_security_token(void)
Get the hawkBit security token.
Definition
config.h:159
sec_tag_t
int sec_tag_t
Secure tag, a reference to TLS credential.
Definition
tls_credentials.h:78
NULL
#define NULL
Definition
iar_missing_defs.h:20
tag
static const char * tag(void)
Definition
main.c:27
stdint.h
uint32_t
__UINT32_TYPE__ uint32_t
Definition
stdint.h:90
int32_t
__INT32_TYPE__ int32_t
Definition
stdint.h:74
uint16_t
__UINT16_TYPE__ uint16_t
Definition
stdint.h:89
hawkbit_runtime_config
hawkBit configuration structure.
Definition
config.h:31
hawkbit_runtime_config::tls_tag
sec_tag_t tls_tag
TLS tag.
Definition
config.h:39
hawkbit_runtime_config::server_port
uint16_t server_port
Server port.
Definition
config.h:35
hawkbit_runtime_config::auth_token
char * auth_token
Security token.
Definition
config.h:37
hawkbit_runtime_config::server_addr
char * server_addr
Server address.
Definition
config.h:33
tls_credentials.h
TLS credentials management.
zephyr
mgmt
hawkbit
config.h
Generated on Mon Apr 21 2025 11:55:48 for Zephyr API Documentation by
1.12.0