log_message_example.c
Go to the documentation of this file.
1 
7 #include "example_common.h"
8 #include "toposens/sensor_lib.h"
9 
10 #include <unistd.h>
11 
12 #define SLEEP_TIME_SECONDS 60 * 60
13 
14 static void LogMsgCallback(uint16_t SenderId_u16, uint8_t* ReceivedPayload_pu8);
15 
16 int main()
17 {
19  InitInterface("can0", 1000000, IF_CAN);
20  sleep(SLEEP_TIME_SECONDS);
21 
23  return 0;
24 }
25 
26 static void LogMsgCallback(uint16_t SenderId_u16, uint8_t* ReceivedPayload_pu8)
27 {
28  PrintLogMessage(SenderId_u16, ReceivedPayload_pu8);
29 }
SLEEP_TIME_SECONDS
#define SLEEP_TIME_SECONDS
Definition: log_message_example.c:12
DeinitInterface
void DeinitInterface(CommsInterfaceType_t Interface_t)
Instruction to deinit the specified interface type.
Definition: sensor_lib.c:2279
LogMsgCallback
static void LogMsgCallback(uint16_t SenderId_u16, uint8_t *ReceivedPayload_pu8)
Definition: log_message_example.c:26
InitInterface
void InitInterface(char *InterfaceName, uint32_t DataRate_u32, CommsInterfaceType_t Interface_t)
Instruction to initialize the specified interface with the specified bit rate. Will also initialize t...
Definition: sensor_lib.c:2225
IF_CAN
@ IF_CAN
Definition: custom_types.h:13
main
int main()
Definition: log_message_example.c:16
sensor_lib.h
This file contains the highlevel interface prototypes to the low-level Protocol.
RegisterLogMsgCallback
void RegisterLogMsgCallback(void(*Callback)(uint16_t Sender_u16, uint8_t *ReceivedPayload_pu8))
Interface function to register a callback function that is called whenever a Logmessage Payload is re...
Definition: sensor_lib.c:3409
example_common.h
Library containing common functions that are used in the various examples.
PrintLogMessage
void PrintLogMessage(uint16_t SenderId_u16, const uint8_t *ReceivedPayload_pu8)
Definition: example_common.c:154


toposens_echo_driver
Author(s): Tobias Roth , Dennis Maier , Baris Yazici
autogenerated on Wed Mar 2 2022 01:12:32