Go to the documentation of this file.
14 #define PORT "/dev/ttyUSB0"
15 #define BAUDRATE B115200
17 static void LogMsgCallback(uint16_t SenderId_u16, uint8_t* ReceivedPayload_pu8);
30 int main(
int argc,
char** argv)
32 int num_of_frames = 0;
37 fprintf(stderr,
"Pass -n argument.\n");
41 while ((c = getopt(argc, argv,
"n:")) != -1)
switch (c)
44 num_of_frames = atoi(optarg);
45 if (num_of_frames < 0) num_of_frames = 0;
49 fprintf(stderr,
"Option -%c requires an argument.\n", optopt);
51 fprintf(stderr,
"Unknown option character `\\x%x'.\n", optopt);
60 printf(
"Blocking Reboot Request worked\n");
64 printf(
"Blocking Reboot Request worked but did not got the right ack\n");
68 printf(
"Starting measurement\n");
70 for (i = 0; i < num_of_frames; i++)
79 static void LogMsgCallback(uint16_t SenderId_u16, uint8_t* ReceivedPayload_pu8)
static void SingleShotMeasurement()
bool RequestReboot()
Request selected sensor to reboot.
void DeinitInterface(CommsInterfaceType_t Interface_t)
Instruction to deinit the specified interface type.
uint16_t WaitForSessionEnd()
Blocking Function call to wait for SessionEnd Payload.
bool RequestMeasurement()
Send's a request to start a new measurement.
uint16_t WaitForReady()
Blocking Function call to wait for Ready Payload.
Sensor_Session_t * GetSessionData(uint16_t Sender_u16)
Interface function to query current session-data (ongoing and closed session)
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...
void PrintSessionData(Sensor_Session_t *Session)
@ SENSOR_MODE_SINGLE_SHOT_TRANSMIT_LISTEN
bool SetParameterSystemSensorMode(SensorMode_t Mode_t)
Blocking Request to set the Sensor Mode for current target sensor.
static void LogMsgCallback(uint16_t SenderId_u16, uint8_t *ReceivedPayload_pu8)
uint16_t WaitForSessionStart()
Blocking Function call to wait for SessionStart Payload.
This file contains the highlevel interface prototypes to the low-level Protocol.
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...
Library containing common functions that are used in the various examples.
void PrintLogMessage(uint16_t SenderId_u16, const uint8_t *ReceivedPayload_pu8)
int main(int argc, char **argv)
toposens-library
Author(s): Andrej Wallwitz, Thomas Böhm
, Sebastian Kruber
autogenerated on Wed Apr 27 2022 08:10:01