File: mapp.c

package info (click to toggle)
dlt-viewer 2.23.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,432 kB
  • sloc: cpp: 27,832; ansic: 4,454; xml: 491; sh: 154; makefile: 75
file content (46 lines) | stat: -rw-r--r-- 1,518 bytes parent folder | download | duplicates (4)
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
/**
 * @licence app begin@
 * Copyright (C) 2014  BMW AG
 *
 * This file is part of COVESA Project Dlt Viewer.
 *
 * Contributions are licensed to the COVESA Alliance under one or more
 * Contribution License Agreements.
 *
 * \copyright
 * 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 http://mozilla.org/MPL/2.0/.
 *
 * \file mapp.c
 * For further information see http://www.covesa.global/.
 * @licence end@
 */

#include "dlt_common_api.h"

#include "dlt_id_MAPP.h"

DLT_DECLARE_CONTEXT(myContext1)
DLT_DECLARE_CONTEXT(myContext2)
DLT_DECLARE_CONTEXT(myContext3)

void main()
{
    DLT_REGISTER_APP("MAPP","My Application");

    DLT_REGISTER_CONTEXT_APP(myContext1,"MCT1","MAPP","My Context 1");
    DLT_REGISTER_CONTEXT_APP(myContext2,"MCT2","MAPP","My Context 2");
    DLT_REGISTER_CONTEXT_APP(myContext3,"MCT3","MAPP","My Context 3");

    DLT_LOG_ID0(myContext1,DLT_LOG_INFO,DLT_MSG_ID_MAPP_MCT1_1);
    DLT_LOG_ID1(myContext2,DLT_LOG_ERROR,DLT_MSG_ID_MAPP_MCT2_1, DLT_STRING("Hello DLT message"));
    DLT_LOG_ID2(myContext3,DLT_LOG_VERBOSE,DLT_MSG_ID_MAPP_MCT3_1, DLT_CSTRING("Hello value"), DLT_INT(-100));
    DLT_LOG_ID3(myContext1,DLT_LOG_FATAL,DLT_MSG_ID_MAPP_MCT1_2, DLT_CSTRING("Hello value2"), DLT_INT(-100), DLT_UINT(200));

    DLT_UNREGISTER_CONTEXT(myContext1);
    DLT_UNREGISTER_CONTEXT(myContext2);
    DLT_UNREGISTER_CONTEXT(myContext3);

    DLT_UNREGISTER_APP();
}