questo a me funziona. Prima non andava quindi ho solo eliminato e rimesso la libreria e ora va
Dependencies: WIZnet_Library mbed
Revision 0:f1f0b48a37df, committed 2018-07-11
- Comitter:
- Wonderjack996
- Date:
- Wed Jul 11 10:48:57 2018 +0000
- Commit message:
- funzioante
Changed in this revision
diff -r 000000000000 -r f1f0b48a37df WIZnet_Library.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WIZnet_Library.lib Wed Jul 11 10:48:57 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/teams/WIZnet/code/WIZnet_Library/#cb8808b47e69
diff -r 000000000000 -r f1f0b48a37df main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jul 11 10:48:57 2018 +0000 @@ -0,0 +1,41 @@ +#include "mbed.h" +#include "WIZnetInterface.h" + +#define MY_DEFAULT_IP_ADDR "10.51.23.95" //IP per comunicare con Siren: 10.51.23.95 - ".95" settabile con Dipswitch +#define MY_DEFAULT_MASK "255.255.255.0" +#define MY_DEFAULT_GATEWAY "10.51.23.254" //Default Gateway della STM32 + +//new server windows 2012 ctosw00014.cto.st.com +#define SIREN_SERVER_NAME "10.51.37.30" +#define SIREN_SERVER_PORT 8897 + +const char * IP_Addr = "10.51.23.95"; +const char * IP_Subnet = "255.255.255.0"; +const char * IP_Gateway = "10.51.23.254"; + +unsigned char MAC_Addr[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; +SPI spi(PA_7,PA_6,PA_5); //MOSI, MISO, SCK +WIZnetInterface ethernet(&spi,PB_6,PA_10); +DigitalOut cs(D10); +DigitalOut reset(D2); + +int main() { + reset = 0; + printf("Start4\r\n"); + TCPSocketConnection(); + int ret = ethernet.init(MAC_Addr,"10.51.23.95",IP_Subnet,IP_Gateway); + + if(!ret){ + printf("Initialized, MAC: %s\r\n", ethernet.getMACAddress()); + ret = ethernet.connect(); + if(!ret){ + printf("IP: %s, MASK: %s, GW: %s\r\n", + ethernet.getIPAddress(), ethernet.getNetworkMask(), ethernet.getGateway()); + }else{ + printf("Error ethernet.connect() - ret = %d\r\n", ret); + } + }else{ + printf("Error ethernet.init() - ret = %d\r\n", ret); + } + while(true); +} \ No newline at end of file
diff -r 000000000000 -r f1f0b48a37df mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Jul 11 10:48:57 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file