75 #define MAXSTRLEN 1024 77 #define PS_DLT_APP_DESC "stdin adaptor application" 78 #define PS_DLT_CONTEXT_DESC "stdin adaptor context" 80 #define PS_DLT_APP "SINA" 81 #define PS_DLT_CONTEXT "SINC" 85 int
main(
int argc,
char* argv[])
99 while ((opt = getopt(argc, argv,
"a:c:ht:v:")) != -1)
115 timeout = atoi(optarg);
122 printf(
"Usage: dlt-adaptor-stdin [options]\n");
123 printf(
"Adaptor for forwarding input from stdin to DLT daemon.\n");
124 printf(
"%s \n", version);
125 printf(
"Options:\n");
126 printf(
" -a apid - Set application id to apid (default: SINA)\n");
127 printf(
" -c ctid - Set context id to ctid (default: SINC)\n");
128 printf(
" -t timeout - Set timeout when sending messages at exit, in ms (Default: 10000 = 10sec)\n");
129 printf(
" -v verbosity level - Set verbosity level (Default: INFO, values: FATAL ERROR WARN INFO DEBUG VERBOSE)\n");
130 printf(
" -h - This help\n");
136 if(!strcmp(optarg,
"FATAL"))
141 else if(!strcmp(optarg,
"ERROR"))
146 else if(!strcmp(optarg,
"WARN"))
151 else if(!strcmp(optarg,
"INFO"))
156 else if(!strcmp(optarg,
"DEBUG"))
161 else if(!strcmp(optarg,
"VERBOSE"))
167 printf(
"Wrong verbosity level, setting to INFO. Accepted values are: FATAL ERROR WARN INFO DEBUG VERBOSE\n");
175 fprintf(stderr,
"Unknown option '%c'\n", optopt);
190 if (strcmp(str,
"")!=0)
int dlt_set_resend_timeout_atexit(uint32_t timeout_in_milliseconds)
#define PS_DLT_CONTEXT_DESC
#define DLT_UNREGISTER_APP()
void dlt_set_id(char *id, const char *text)
int main(int argc, char *argv[])
DLT_DECLARE_CONTEXT(mycontext)
#define DLT_REGISTER_APP(APPID, DESCRIPTION)
#define DLT_REGISTER_CONTEXT(CONTEXT, CONTEXTID, DESCRIPTION)
#define DLT_UNREGISTER_CONTEXT(CONTEXT)
#define DLT_LOG(CONTEXT, LOGLEVEL, ARGS...)
void dlt_get_version(char *buf, size_t size)
static char str[DLT_DAEMON_TEXTBUFSIZE]