|
9 | 9 | #include <WiShield.h>
|
10 | 10 | #include <dataflash.h>
|
11 | 11 |
|
12 |
| -#define WIRELESS_MODE_INFRA 1 |
13 |
| -#define WIRELESS_MODE_ADHOC 2 |
14 |
| - |
15 |
| -#define FLASH_SLAVE_SELECT 7 |
16 |
| -#define WIFI_SLAVE_SELECT 10 |
17 |
| - |
18 | 12 | // Wireless configuration parameters ----------------------------------------
|
19 |
| -unsigned char local_ip[] = {192,168,1,2}; // IP address of WiShield |
20 |
| -unsigned char gateway_ip[] = {192,168,1,1}; // router or gateway IP address |
21 |
| -unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network |
22 |
| -const prog_char ssid[] PROGMEM = {"ASYNCLABS"}; // max 32 bytes |
23 |
| - |
24 |
| -unsigned char security_type = 0; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2 |
| 13 | +unsigned char local_ip[] = {192,168,1,2}; // IP address of WiShield |
| 14 | +unsigned char gateway_ip[] = {192,168,1,1}; // router or gateway IP address |
| 15 | +unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network |
| 16 | +char ssid[] = {"ASYNCLABS"}; // max 32 bytes |
| 17 | +unsigned char security_type = 0; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2 |
25 | 18 |
|
26 | 19 | // WPA/WPA2 passphrase
|
27 | 20 | const prog_char security_passphrase[] PROGMEM = {"12345678"}; // max 64 characters
|
28 | 21 |
|
29 | 22 | // WEP 128-bit keys
|
30 |
| -// sample HEX keys |
31 |
| -prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, // Key 0 |
32 |
| - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 1 |
33 |
| - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 2 |
34 |
| - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Key 3 |
35 |
| - }; |
36 |
| - |
37 |
| -// setup the wireless mode |
38 |
| -// infrastructure - connect to AP |
39 |
| -// adhoc - connect to another WiFi device |
| 23 | +prog_uchar wep_keys[] PROGMEM = { |
| 24 | + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, // Key 0 |
| 25 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 1 |
| 26 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 2 |
| 27 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Key 3 |
| 28 | +}; |
| 29 | + |
| 30 | +// setup the wireless mode; infrastructure - connect to AP; adhoc - connect to another WiFi device |
| 31 | +#define WIRELESS_MODE_INFRA 1 |
| 32 | +#define WIRELESS_MODE_ADHOC 2 |
40 | 33 | unsigned char wireless_mode = WIRELESS_MODE_INFRA;
|
41 |
| - |
42 | 34 | unsigned char ssid_len;
|
43 | 35 | unsigned char security_passphrase_len;
|
44 |
| -//--------------------------------------------------------------------------- |
| 36 | +// End of wireless configuration parameters ---------------------------------------- |
| 37 | + |
| 38 | +// Dataflash configuration parameters ---------------------------------------- |
| 39 | +#define FLASH_SLAVE_SELECT 7 |
| 40 | +#define WIFI_SLAVE_SELECT 10 |
| 41 | +// End of Dataflash configuration parameters ---------------------------------------- |
| 42 | + |
45 | 43 |
|
46 | 44 | unsigned char mfg_id[4];
|
47 | 45 |
|
|
0 commit comments