Hallo,

ich habe ein Problem mit UDP_DIRECT_SEND im control6 scripting, vermutlich mit type casting.
Wenn ich im control6-Script mit
UDP_DIRECT_SEND(192.168.1.5, 2701, 2701, "Hello world.");
sende, funktioniert es.

Möchte ich allerdings den string durch eine Variable ersetzen, bekomme ich beim Übersetzen diverse Fehler wahrscheinlich aufgrund des falschen Variablentypen. Ich habe schon diverse type casts ausprobiert, bin aber nicht zum Ziel gekommen. Die Variable, welche ich nutzen müsste, ist wie folgt definiert:
char buf1[24];

Die Fehlermeldungen beim Make stehen unten einkopiert.
Weiss jemand mit entsprechenden c Kenntnissen Bescheid, wie ich den richtigen type-cast für UDP_DIRECT_SEND machen kann? Leider lässt sich das für mich im Quellcode nicht wirklich erkennen. Im Quellcode sieht es so aus, als wenn letztlich mit PSTR auf den Parameter zugegriffen wird.

Besten Gruß.

Tjareson

avr-gcc -Wall -W -Wno-unused-parameter -Wno-sign-compare -Wno-char-subscripts -g -Os -std=gnu99 -fdata-sections -ffunction-sections -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -mcall-prologues -fshort-enums -fno-strict-aliasing -Iprotocols/usb/usbdrv -Iprotocols/usb -DAVR_BUILD -DF_CPU=16000000UL -mmcu=atmega1284p -I. -c -o control6/control6.o control6/control6.c
control6/control6.c: In function ‘action_thread_cmdloop’:
control6/control6.c:158:3: warning: variable ‘PT_YIELD_FLAG’ set but not used [-Wunused-but-set-variable]
control6/control6.c: In function ‘action_thread_sendloop’:
control6/control6.c:222:5: error: invalid initializer
control6/control6.c:222:5: warning: pointer targets in passing argument 1 of ‘strcpy_P’ differ in signedness [-Wpointer-sign]
In file included from control6/control6.c:3:0:
/usr/lib/gcc/avr/4.7.2/../../../avr/include/avr/pgmspace.h:1047:14: note: expected ‘char *’ but argument is of type ‘u8_t *’ control6/control6.c:223:3: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
In file included from ./hardware/adc/kty/kty81.h:21:0,
                 from control6/control6.c:9:
/usr/lib/gcc/avr/4.7.2/../../../avr/include/string.h:133:15: note: expected ‘const char *’ but argument is of type ‘u8_t *’ control6/control6.c:249:3: warning: pointer targets in passing argument 1 of ‘strcpy_P’ differ in signedness [-Wpointer-sign]
In file included from control6/control6.c:3:0:
/usr/lib/gcc/avr/4.7.2/../../../avr/include/avr/pgmspace.h:1047:14: note: expected ‘char *’ but argument is of type ‘u8_t *’ control6/control6.c:250:3: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
In file included from ./hardware/adc/kty/kty81.h:21:0,
                 from control6/control6.c:9:
/usr/lib/gcc/avr/4.7.2/../../../avr/include/string.h:133:15: note: expected ‘const char *’ but argument is of type ‘u8_t *’ control6/control6.c:271:3: warning: pointer targets in passing argument 1 of ‘strcpy_P’ differ in signedness [-Wpointer-sign]
In file included from control6/control6.c:3:0:
/usr/lib/gcc/avr/4.7.2/../../../avr/include/avr/pgmspace.h:1047:14: note: expected ‘char *’ but argument is of type ‘u8_t *’ control6/control6.c:272:3: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
In file included from ./hardware/adc/kty/kty81.h:21:0,
                 from control6/control6.c:9:
/usr/lib/gcc/avr/4.7.2/../../../avr/include/string.h:133:15: note: expected ‘const char *’ but argument is of type ‘u8_t *’ control6/control6.c:293:3: warning: pointer targets in passing argument 1 of ‘strcpy_P’ differ in signedness [-Wpointer-sign]
In file included from control6/control6.c:3:0:
/usr/lib/gcc/avr/4.7.2/../../../avr/include/avr/pgmspace.h:1047:14: note: expected ‘char *’ but argument is of type ‘u8_t *’ control6/control6.c:294:3: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
In file included from ./hardware/adc/kty/kty81.h:21:0,
                 from control6/control6.c:9:
/usr/lib/gcc/avr/4.7.2/../../../avr/include/string.h:133:15: note: expected ‘const char *’ but argument is of type ‘u8_t *’
control6/control6.c: In function ‘action_thread_keepalive’:
control6/control6.c:324:3: warning: pointer targets in passing argument 1 of ‘strcpy_P’ differ in signedness [-Wpointer-sign]
In file included from control6/control6.c:3:0:
/usr/lib/gcc/avr/4.7.2/../../../avr/include/avr/pgmspace.h:1047:14: note: expected ‘char *’ but argument is of type ‘u8_t *’ control6/control6.c:325:3: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
In file included from ./hardware/adc/kty/kty81.h:21:0,
                 from control6/control6.c:9:
/usr/lib/gcc/avr/4.7.2/../../../avr/include/string.h:133:15: note: expected ‘const char *’ but argument is of type ‘u8_t *’
make: *** [control6/control6.o] Fehler 1







_______________________________________________
Ethersex-devel mailing list
Ethersex-devel@list.zerties.org
http://list.zerties.org/cgi-bin/mailman/listinfo/ethersex-devel

Antwort per Email an