-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdronecan_application_internal.h
56 lines (45 loc) · 1.41 KB
/
dronecan_application_internal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Copyright (C) 2023 Dmitry Ponomarev <ponomarevda96@gmail.com>
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#ifndef APPLICATION_DRONECAN_APPLICATION_INTERNAL_H_
#define APPLICATION_DRONECAN_APPLICATION_INTERNAL_H_
#include <stdint.h>
#include "libcanard_v0/canard.h"
#define UAVCAN_EXPAND(data_type) data_type##_SIGNATURE, data_type##_ID
#ifndef STATUS_ERROR
#define STATUS_ERROR -1
#endif
/**
* @brief Encapsulate everything related to a date type
*/
typedef struct {
uint64_t sig;
uint16_t id;
} UavcanDataType_t;
#ifdef __cplusplus
extern "C" {
#endif
/**
* @return the time in milliseconds since the application started.
* @note This function must be provided by a user!
*/
uint32_t platformSpecificGetTimeMs();
/**
* @return whether the request will be processed
* True - the application will be restarted soon.
* False - the restarted is not supported or can't be handled at the moment.
* @note Implementation is recommended, but optional.
*/
bool platformSpecificRequestRestart();
/**
* @param[out] out_id - hardware Unique ID
* @note Implementation is recommended, but optional.
*/
void platformSpecificReadUniqueID(uint8_t out_uid[16]);
#ifdef __cplusplus
}
#endif
#endif // APPLICATION_DRONECAN_APPLICATION_INTERNAL_H_