Help - Search - Members - Calendar
Full Version: DSWifi Lib - Q&A
1Emulation.Com > Official Emulator Forums > DSWifi
sgstair
If you guys have major questions about coding using the released lib, please post them here, so we can have a knowledge-base of sorts for people just starting out.

-Stephen
Lockwood
I have some problems with compiling.
When I open my template its empty.
Were do i need to place the libraray?
El_Hobito
what do i need to do to get the includes to work? I assume i have to set up the enviroment variables? im just getting undefined references?
Sintax
To get the includes to work, if you're working off the test app example, you'll notice there are include paths hardcoded into the makefiles. Go to the arm9 and arm7 makefiles and change the paths to where the lib is located on your computer. There's probably a better way to do this without hardcoding, but I'm no makefile expert.

-------------

Fixed my own problem because of a stupid bug tongue.gif
sgstair
Yeah, the test project does have hardcoded paths for the include files and libraries - in order to use the test project, just modify the paths in the makefile.

To make a new project, either add the include files' path to the makefile, or copy the include files into your project... then include the.lib files in your project too (could copy them to your project dir too)

-Stephen
thoduv
When will you release your lib with TCP support ? You known that UDP isn't used at all on the internet...
The first reals internet apps will come when you will release DNS and TCP. Many devs and users are waiting for this first "useful" release for long times, and it doesn't arrive !..
El_Hobito
QUOTE (thoduv @ Jan 9 2006, 05:17 PM)
When will you release your lib with TCP support ? You known that UDP isn't used at all on the internet...
The first reals internet apps will come when you will release DNS and TCP. Many devs and users are waiting for this first "useful" release for long times, and it doesn't arrive !..
*

actually udp is used quite a bit on the internet for streaming applications that do not require bit perfect transmission at the fastest possible speed.

edit. oh and thanks for the reply!
El_Hobito
lol, ignore the post that was here i really shouldnt code late at night after i've been drinking! PAlib works great with wifi
yorel
i have some problem with the file sgIP_sockets.c of the lib source. I'm trying to compile ( devkitpro ) but some errors with pointers appear...

it is said :
"In file included from c:/Projects/HelloWorld/source/main.c:8:
C:\...\source\sgIP_sockets.c:81: warning: 'struct sockaddr_in' declared inside parameter list
C:\...\source\sgIP_sockets.c:81: warning: its scope is only this definition or declaration, which is probably not what you want
C:\...\source\sgIP_sockets.c: In function 'bind':
C:\...\source\sgIP_sockets.c:89: error: dereferencing pointer to incomplete type
C:\...\source\sgIP_sockets.c:90: error: dereferencing pointer to incomplete type"

I have the same type of problem in function 'sendto' and recvfrom.

I have tried some possibility but none seem to work...

The code :

CODE
int bind(int socket, struct sockaddr_in *addr, int addr_len)
{
...
retval=sgIP_UDP_Bind((sgIP_Record_UDP *)socketlist[socket].conn_ptr,
((struct sockaddr_in *)addr)->sin_port, //PROB HERE
((struct sockaddr_in *)addr)->sin_addr.s_addr); // PROB HERE
}


The function sgi^p_UDP_Bind is :

CODE
int sgIP_UDP_Bind(sgIP_Record_UDP * rec, int srcport, unsigned long srcip)


I have tried a cast, &, *... i don't find. ohmy.gif
sgstair
yorel:
The only thing I can think of is that you have your include directories set up wrong somehow. The code in the lib compiled on my end when I posted it, though there were a number of pitfalls as far as moving the project to anyone else's computer. If you can wait a few more days, the new lib version features an all new build system which should be able to build on any computer without issue.

-Stephen
yorel
Indeed, i change the struct sockadress_in of file and these errors have vanished... for others... Bouh Bouh Bouh...

i'm going to try an other solution. i have to do a conversation between a PC and a DS...

Jl
fischju
I dont know if he already has an account here but Alias-Zero needs help.....He is making HelloDS ya know? He has a gui but i doubt he has ANY idea on how to implement wifi...he has been procrastinating for months now http://www.ghzsystems.com/azero/hellods/news.php
Alias-Zero
Don't post things like this, please. afro.gif

If I needed help I would've asked.
fischju
aaw comon man.......any progress at all?
Alias-Zero
QUOTE (fischju @ Mar 15 2006, 12:20 AM)
aaw comon man.......any progress at all?
*



Actually yeah, I was working on it about 2 hours ago.
fischju
woo....what are you building it in? devkitpro? i jsut got a book on c and it will take me 2 or 3 weeks to memorize it (and the way you make progress that remarkebly fast) so i might be able to help
yorel
I have one more question :

How can i do to delete these 'warning' message :

1°)

c:/.../main.c:809: warning: 'struct sockaddr' declared inside parameter list
c:/.../main.c:809: warning: its scope is only this definition or declaration, which is probably not what you want

CODE
int bind(int socket,const struct sockaddr * addr, int addr_len) {;};


2°)

c:/.../main.c:1187: warning: type-punning to incomplete type might break strict-aliasing rules
c:/.../main.c:1187: warning: passing argument 5 of 'sendto' from incompatible pointer type

CODE
int sendto(int socket, const void * data, int sendlength, int flags, const struct sockaddr * addr, int addr_len) {... };

...

sendto(sock,sendbuf,strlen(sendbuf),0,(struct sockaddr *)&sain,sizeof(sain));
sgstair
yorel: do a full rebuild and post all of the warnings somewhere - I beleive you have a problem with include paths, or you may have modified part of the lib to introduce some problems (either of these would cause all of those warnings)

On a side note...
fischju: I know you're trying to be helpful but you're not really helping - let people speak for themselves please.

-Stephen
yorel
i'm actually on my home pc ( 350Mz, 98... ) I do a rebuild tomorrow (8h30 for me in belgium ^^ ) at the university.

the warnings are all the same. I have two times the first one and five or six the second one. I have no more errors, so i have a beautiful "ds.gba" file.

EDIT : So, here all the warnings message but i doubt that it will be very usefull.

> "make"
main.c
c:/Projects/HelloWorld/source/main.c:809: warning: 'struct sockaddr' declared inside parameter list
c:/Projects/HelloWorld/source/main.c:809: warning: its scope is only this definition or declaration, which is probably not what you want
c:/Projects/HelloWorld/source/main.c:869: warning: 'struct sockaddr' declared inside parameter list
c:/Projects/HelloWorld/source/main.c:922: warning: 'struct sockaddr' declared inside parameter list
c:/Projects/HelloWorld/source/main.c: In function 'main':
c:/Projects/HelloWorld/source/main.c:1082: warning: type-punning to incomplete type might break strict-aliasing rules
c:/Projects/HelloWorld/source/main.c:1082: warning: passing argument 2 of 'bind' from incompatible pointer type
c:/Projects/HelloWorld/source/main.c:1110: warning: type-punning to incomplete type might break strict-aliasing rules
c:/Projects/HelloWorld/source/main.c:1110: warning: passing argument 5 of 'sendto' from incompatible pointer type
c:/Projects/HelloWorld/source/main.c:1118: warning: type-punning to incomplete type might break strict-aliasing rules
c:/Projects/HelloWorld/source/main.c:1118: warning: passing argument 5 of 'recvfrom' from incompatible pointer type
c:/Projects/HelloWorld/source/main.c:1177: warning: type-punning to incomplete type might break strict-aliasing rules
c:/Projects/HelloWorld/source/main.c:1177: warning: passing argument 5 of 'sendto' from incompatible pointer type
c:/Projects/HelloWorld/source/main.c:1187: warning: type-punning to incomplete type might break strict-aliasing rules
c:/Projects/HelloWorld/source/main.c:1187: warning: passing argument 5 of 'sendto' from incompatible pointer type
arm-elf-g++ -g -mthumb-interwork -mno-fpu -L/c/devkitPro/PAlib/lib -specs=ds_arm9.specs main.o wifi_arm7.o -Lc:/devkitPro/PAlib//lib -lpa9 -L/c/devkitPro/libnds/lib -lnds9 -o build.elf
Nintendo DS rom tool 1.24 - Oct 19 2005 20:26:11 by Rafael Vuijk (aka DarkFader)
built... HelloWorld.ds.gba
dsbuild 1.21 - Oct 19 2005
using default loader

> Process Exit Code: 0
> Time Taken: 00:08

The code is in the 'little demo game topic'. I send it to sgstair@akkit.org, too.
flagon
Hi.. I am having issues linking in the library.. The Arm7 builds ok, but the arm 9 doesnt. Below is the output of make... It dies with all these undefined reference to C:\DS\projects... My path is not setup that way. I changed the makefile, and the only reference I can find in my computer to C:\DS\projects is in the.lib files themselves(I ran a grep over everything)... I think i am missing something pretty basic, but I have been staring at this for a while..

So if anyone has any suggestions, please send them my way!

Good work on the wifilib.. Looks like it will be great if I can use it!


C:\devkitPro\examples\nds\nettest>make
arm-elf-g++ -g -Wall -O2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I/c/devkitPro/libnds/include -I/c/devkitPro/wifi_lib
/include -DARM7 -c arm7_main.cpp -oarm7_main.o

arm-elf-g++ -g -mthumb-interwork -mno-fpu -specs=ds_arm7.specs arm7_main.o /c/devkitpro/wifi_lib/lib/dswifi7.lib -L/c/devkitPro/libnds/lib -lnds7 -oarm7.elf
arm-elf-objcopy -O binary arm7.elf arm7.bin
arm-elf-g++ -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I/c/devkitPro/libnds/include -I/c/devkitPro/wifi_lib/include -DARM9 -c arm9_main.cpp -oarm9_main.o



arm-elf-g++ -g -mthumb-interwork -mno-fpu -specs=ds_arm9.specs arm9_main.o /c/devkitpro/wifi_lib/lib/dswifi9.lib -L/c/devkitPro/libnds/lib -lnds9 -o arm9.elf
c:/devkitpro/wifi_lib/lib/dswifi9.lib(sgIP_memblock.o): In function `sgIP_memblock_Init':
c:/DS/projects/wifi_lib/arm9/source/sgIP_memblock.c:60: undefined reference to `sgIP_malloc'
c:/devkitpro/wifi_lib/lib/dswifi9.lib(wifi_arm9.o): In function `ethhdr_print':
c:/DS/projects/wifi_lib/arm9/source/wifi_arm9.c:93: undefined reference to `sgIP_dbgprint'
c:/devkitpro/wifi_lib/lib/dswifi9.lib(wifi_arm9.o): In function `Wifi_TransmitFunction':
c:/DS/projects/wifi_lib/arm9/source/wifi_arm9.c:302: undefined reference to `sgIP_dbgprint'

lots more undefined references follow...
Sintax
Those are external functions the lib uses for debugging and such, you just need to have them declared. Put this in your arm9 code:

CODE
extern "C" {
void * sgIP_malloc(int size) { return malloc(size); }
void sgIP_free(void * ptr) { free(ptr); }

void sgIP_dbgprint(char * txt,...) {  //Uncomment this for debug output
/*    char buffer[256];
    va_list args;
    va_start(args,txt);
    vsprintf(buffer,txt,args);
    iprintf (buffer);
    iprintf ("\n");*/
}
}
flagon
Cool thanks!

I had the functions, just not extern'd.

Thanks a bunch!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.