Projekt

Allgemein

Profil

Eval » main.cpp

Redmine Admin, 05.10.2021 15:55

 
1
#include <QCoreApplication>
2

    
3
#include <QJsonDocument>
4
#include <QJsonObject>
5
#include <QJsonValue>
6
#include <QDebug>
7
#include <QVariant>
8
#include <QMap>
9
#include <QDataStream>
10
#include <QByteArray>
11
#include <nlohmann/json.hpp>
12
#include <unistd.h>
13

    
14
struct SMyStruct
15
{
16
  char name[10];
17
  int version;
18
  uint8_t day;
19
  uint8_t month;
20
  uint8_t year;
21
  uint32_t serial;
22
};
23

    
24
SMyStruct myStruct={"444", 12,0,0,0,0x12345678};
25

    
26
int flash(int version, const char *name)
27
{
28
  printf("Flashing: \n");
29
  printf("   Version: %d\n",version);
30
  printf("   Name: %s\n", name);
31
  myStruct.version=version;
32
  strncpy(myStruct.name, name, 10);
33

    
34
  return(0);
35
}
36

    
37

    
38
int flashP(SMyStruct *s)
39
{
40
  printf("Flashing: \n");
41
  printf("   Version: %d\n",s->version);
42
  printf("   Name: %s\n", s->name);
43
  printf("   Serial: 0x%08X\n", s->serial);
44
  myStruct.version=s->version;
45
  myStruct.serial=s->serial;
46
  strncpy(myStruct.name, s->name, 10);
47

    
48
  return(1);
49
}
50

    
51

    
52
SMyStruct *info()
53
{
54
  return(&myStruct);
55
}
56

    
57
/*
58
int loop()
59
{
60
  return(0);
61
}
62
*/
63

    
64
int main(int argc, char *argv[])
65
{
66

    
67
  int counter=0;
68
  while(1)
69
  {
70
    loop:
71
    //loop();
72
    usleep(1000 * 1000);
73
    printf("Counter: %d\n", counter);
74
    counter ++;
75
  }
76
    //return a.exec();
77
    return 0;
78
}
(2-2/3)