can anybody tell me why the following will not work
I'm trying to store the wiznet config settings in a struct so i can eventually store and retrieve from the eeprom so that i don't have to hard code the settings
setting up byte arrays and passing them to ethernet.begin works but not when i pass them in from the struct
#include <Ethernet.h>
struct config_t
{
byte mac[6];
byte ip[4];
byte subnet[4];
byte gateway[4];
byte server[4];
char path[192];
};
struct config_t configuration = {
{
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }
, {
192,168,0,54 }
, {
255,255,255,0 }
, {
192,168,0,1 }
, {
73,86,153,136 }
,{
'/','p','\0' }
};
Client client(configuration.server, 80);
void setup()
{
Ethernet.begin(configuration.mac, configuration.ip, configuration.gateway, configuration.subnet);
Serial.begin(9600);
delay(500);
Serial.println("Ready:");
}
void loop()
{
if (client.connect()) {
client.println("Test");
client.println();
client.stop();
}
else {
Serial.println("connection failed");
}
}
Thanks
JEff