dswifi0.3.11のプロジェクト
dswifi0.3.11を自作プロジェクトに組み込んでMakeできるようにしたので、その条件だけを簡単に説明しようと思います。
フォルダは下記のような感じに作りました。
dswifiというフォルダにarm7、arm9、common.hというフォルダを作り、arm7とcommon.hフォルダには下記のようなフォルダとファイルを入れて、
arm9には下記のようなファイルとフォルダを入れます。
見えるかな、ぎりぎり見えるかな。
arm9/source/dswifiフォルダ
ソースを解凍して出てきたarm9/source下にあるソース一式を入れます。
sgIP.c
sgIP.h
sgIP_ARP.c
sgIP_ARP.h
sgIP_Config.h
sgIP_DHCP.c
sgIP_DHCP.h
sgIP_DNS.c
sgIP_DNS.h
sgIP_Hub.c
sgIP_Hub.h
sgIP_ICMP.c
sgIP_ICMP.h
sgIP_IP.c
sgIP_IP.h
sgIP_memblock.c
sgIP_memblock.h
sgIP_sockets.c
sgIP_sockets.h
sgIP_TCP.c
sgIP_TCP.h
sgIP_UDP.c
sgIP_UDP.h
wifi_arm9.c
wifi_arm9.h
そして、ソースを解凍して出てきたinclude下にあるnetdb.hを入れます。
netdb.h
さらに、ソースを解凍して出てきたinclude下にあるnetinetフォルダとsysフォルダをそのままコピーして入れます。
netinet/in.h
sys/socket.h
arm9のMakefile
arm9のMakefileを下記のように変更します。
#--------------------------------------------------------------------------------- # BUILD is the directory where object files & intermediate files will be placed # SOURCES is a list of directories containing source code # INCLUDES is a list of directories containing extra header files # DATA is a list of directories containing binary files # all directories are relative to this makefile #--------------------------------------------------------------------------------- BUILD := build SOURCES := source source/dswifi ../common.h INCLUDES := include ../common.h DATA := data := data
#--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project #--------------------------------------------------------------------------------- #LIBS := -lfat -ldswifi9 -lnds9 LIBS := -lfat -lnds9 #LIBS := -lnds9
↑-ldswifi9を取ります。
arm7のMakefile
arm7のMakefileを下記のように変更します。
#--------------------------------------------------------------------------------- # BUILD is the directory where object files & intermediate files will be placed # SOURCES is a list of directories containing source code # INCLUDES is a list of directories containing extra header files # DATA is a list of directories containing binary files # all directories are relative to this makefile #--------------------------------------------------------------------------------- BUILD := build SOURCES := source source/dswifi ../common.h INCLUDES := include build ../common.h DATA :=
#LIBS := -ldswifi7 -lnds7 LIBS := -lnds7
↑-ldswifi7を取ります。
wifiを使うときのヘッダ
実際プログラム中でwifi関数を使うときには、下記をincludeすれば使えます。
#include "dswifi9.h" #include "netinet/in.h" #include "netdb.h" #include "sys/socket.h"
以上です。ソースはhttp://sourceforge.jp/projects/sfnet_devkitpro/releases/からダウンロードできます。
本当にやりたいことリスト
(ブログの終わりにやりたいことを書いておきたいと思います)
- 求職活動・・・このブログで興味を持った人一声かけてください。m(_ _)m
- Androidプログラム
- Web系のプログラム