93 printf(
"Usage: dlt-example-user-func [options] message\n");
94 printf(
"Generate DLT messages and store them to file or send them to daemon.\n");
95 printf(
"%s \n", version);
97 printf(
" -d delay Milliseconds to wait between sending messages (Default: 500)\n");
98 printf(
" -f filename Use local log file instead of sending to daemon\n");
99 printf(
" -n count Number of messages to be generated (Default: 10)\n");
100 printf(
" -g Switch to non-verbose mode (Default: verbose mode)\n");
101 printf(
" -a Enable local printing of DLT messages (Default: disabled)\n");
107 int main(
int argc,
char* argv[])
124 while ((c = getopt (argc, argv,
"vgad:f:n:")) != -1)
155 if (optopt ==
'd' || optopt ==
'f' || optopt ==
'n')
157 fprintf (stderr,
"Option -%c requires an argument.\n", optopt);
159 else if (isprint (optopt))
161 fprintf (stderr,
"Unknown option `-%c'.\n", optopt);
165 fprintf (stderr,
"Unknown option character `\\x%x'.\n",optopt);
180 for (index = optind; index < argc; index++)
182 message = argv[index];
188 fprintf(stderr,
"ERROR: No message selected\n");
222 maxnum = atoi(nvalue);
231 delay = atoi(dvalue) * 1000;
269 for (num=0;num<maxnum;num++)
271 printf(
"Send %d %s\n",num,text);
311 printf(
"Injection %d, Length=%d \n",service_id,length);
315 printf(
"%s \n", text);
DltReturnValue dlt_user_log_write_float32(DltContextData *log, float32_t data)
DltReturnValue dlt_user_log_write_string(DltContextData *log, const char *text)
DltReturnValue dlt_user_log_write_int(DltContextData *log, int data)
DltReturnValue dlt_unregister_app(void)
int dlt_user_injection_callback(uint32_t service_id, void *data, uint32_t length)
DltReturnValue dlt_register_app(const char *appid, const char *description)
DltReturnValue dlt_print_mixed_string(char *text, int textlength, uint8_t *ptr, int size, int html)
DltReturnValue dlt_register_context(DltContext *handle, const char *contextid, const char *description)
DltReturnValue dlt_init_file(const char *name)
DltReturnValue dlt_enable_local_print(void)
static char * service_id[]
static char data[kDataSize]
DltReturnValue dlt_user_log_write_uint8(DltContextData *log, uint8_t data)
DltReturnValue dlt_user_log_write_uint32(DltContextData *log, uint32_t data)
DltReturnValue dlt_user_log_write_start_id(DltContext *handle, DltContextData *log, DltLogLevelType loglevel, uint32_t messageid)
int main(int argc, char *argv[])
void dlt_get_version(char *buf, size_t size)
DltReturnValue dlt_register_injection_callback(DltContext *handle, uint32_t service_id, int(*dlt_injection_callback)(uint32_t service_id, void *data, uint32_t length))
DltContextData mycontextdata
DltReturnValue dlt_user_log_write_uint16(DltContextData *log, uint16_t data)
DltReturnValue dlt_nonverbose_mode(void)
DltReturnValue dlt_unregister_context(DltContext *handle)
DltReturnValue dlt_user_log_write_finish(DltContextData *log)
DltReturnValue dlt_user_log_write_start(DltContext *handle, DltContextData *log, DltLogLevelType loglevel)