Hallo! Ich habe zwei Strukturen. Eine Hauptstruktur und eine
Unterstruktur, bei der Hauptstruktur kann ich die Werte ändern und diese
werden dann auch übernommen. Aber bei der Unterstruktur kann ich auf die
Elemente zugreifen, diese werden aber nicht verändert. Was mache ich
falsch?
1 | typedef struct //Unterstruktur
|
2 | {
|
3 | uint8_t REC[4];
|
4 | uint8_t Date [9];
|
5 | uint8_t TelNumber[18];
|
6 | uint8_t Time[5];
|
7 | uint8_t Content[31];
|
8 | }RecSMS;
|
9 |
|
10 | typedef struct //Hauptstruktur
|
11 | {
|
12 | uint8_t TryCount;
|
13 | uint8_t TelNumber[30];
|
14 | uint8_t Command[25];
|
15 | uint8_t BufferIndex;
|
16 | RecSMS RecievedSMS;
|
17 | }GSM_Struct;
|
18 |
|
19 |
|
20 | void func2 (RecSMS *sms)
|
21 | {
|
22 | sms -> Content[0] = 'A'; //wird nicht übernommen
|
23 |
|
24 | }
|
25 |
|
26 | void func1 (GSM_Struct* gsm)
|
27 | {
|
28 | gsm -> Command[0] = 'A'; //wird übernommen!
|
29 | func2(gsm -> RecievedSMS);
|
30 |
|
31 | }
|
32 |
|
33 |
|
34 | int main (void)
|
35 | {
|
36 | GSM_Struct GSM;
|
37 | ....
|
38 |
|
39 | while(1)
|
40 | {
|
41 | func1(&GSM);
|
42 |
|
43 | }
|
44 |
|
45 | return 0;
|