diff options
author | Cristian Maglie <c.maglie@bug.st> | 2013-04-03 13:51:04 +0200 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2013-04-03 13:51:04 +0200 |
commit | ee90e68e86dd61d86f5d17b69080338328765b22 (patch) | |
tree | e620c0edc2690ab789b665e567910640597aa6fe /firmwares/wifishield/wifiHD/src/ard_spi.h | |
parent | 0ecdc5ebc96ad4c7c548c438a03d9ce00679db8b (diff) | |
parent | f50c307be280dc6ece9e70c43b301c1db36291a0 (diff) |
Merged 1.0.5
Merge remote-tracking branch 'arduino/master' into ide-1.5.x
Conflicts:
app/src/processing/app/Base.java
build/shared/revisions.txt
hardware/arduino/avr/cores/arduino/malloc.c
hardware/arduino/cores/arduino/avr-libc/malloc.c
hardware/arduino/cores/arduino/malloc.c
todo.txt
Diffstat (limited to 'firmwares/wifishield/wifiHD/src/ard_spi.h')
-rw-r--r-- | firmwares/wifishield/wifiHD/src/ard_spi.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/firmwares/wifishield/wifiHD/src/ard_spi.h b/firmwares/wifishield/wifiHD/src/ard_spi.h index 628f115..27ec33e 100644 --- a/firmwares/wifishield/wifiHD/src/ard_spi.h +++ b/firmwares/wifishield/wifiHD/src/ard_spi.h @@ -37,19 +37,27 @@ typedef enum { CMD_IMM_SET_FLAG = 0x04, }cmd_flags; +typedef enum eProtMode {TCP_MODE, UDP_MODE}tProtMode; + #define TIMEOUT_SPI 200 #define SPI_ALIGN_ERROR 0xF0 #define SPI_OVERRIDE_ERROR 0xF1 +#define SPI_TIMEOUT_ERROR 0xF2 #define DUMMY_DATA 0xFF typedef int (*cmd_spi_cb_t)(int numParam, char* buf, void* ctx); typedef cmd_spi_state_t (*cmd_spi_rcb_t)(char* recv, char* reply, void* ctx, uint16_t* _count); +typedef struct eRemoteClient{ + uint32_t ipaddr; + uint16_t port; +}tRemoteClient; + void set_result_cmd(int err) ; void set_result(wl_status_t _status); -int initSpi(void); +int initSpi(void* ctx); void initExtInt(); @@ -61,10 +69,20 @@ void showTTCPstatus(); int getSock(void * _ttcp); -void* getTTCP(uint8_t sock); +void* getTTCP(uint8_t sock, uint8_t mode); + +void setMapSockMode(uint8_t sock, void* _ttcp, uint8_t _tcp_mode); + +void clearMapSockTcp(uint8_t sock, uint8_t mode); + +int start_server_tcp(uint16_t port, uint8_t sock, uint8_t protMode); + +int start_client_tcp(uint32_t _addr, uint16_t port, uint8_t sock, uint8_t protMode); + +void setRemoteClient(uint16_t sock, uint32_t _ipaddr, uint16_t _port); -void clearMapSockTcp(uint8_t sock); +tRemoteClient* getRemoteClient(uint16_t sock); -int start_server_tcp(uint16_t port, uint8_t sock); +void getRemoteData(uint8_t sock, uint8_t mode, tRemoteClient* remoteData); #endif /* ARD_SPI_H_ */ |