#include <CC3000.hh>
|
| Driver () |
|
virtual int | available () |
|
virtual int | room () |
|
virtual int | write (const void *buf, size_t size) |
|
virtual int | write_P (const void *buf, size_t size) |
|
virtual int | read (void *buf, size_t size) |
|
virtual int | flush () |
|
virtual int | open (Protocol proto, uint16_t port, uint8_t flag) |
|
virtual int | close () |
|
virtual int | listen () |
|
virtual int | accept () |
|
virtual int | connect (uint8_t addr[4], uint16_t port) |
|
virtual int | connect (const char *hostname, uint16_t port) |
|
virtual int | is_connected () |
|
virtual int | disconnect () |
|
virtual int | datagram (uint8_t addr[4], uint16_t port) |
|
virtual int | recv (void *buf, size_t len) |
|
virtual int | recv (void *buf, size_t len, uint8_t src[4], uint16_t &port) |
|
void | src (INET::addr_t &addr) const |
|
Protocol | proto () const |
|
uint16_t | port () const |
|
virtual int | write (const iovec_t *vec) |
|
virtual int | getchar () |
|
virtual int | read (iovec_t *vec) |
|
int | send (const void *buf, size_t len) |
|
int | send (const void *buf, size_t len, uint8_t dest[4], uint16_t port) |
|
int | send_P (const void *buf, size_t len) |
|
int | send_P (const void *buf, size_t len, uint8_t dest[4], uint16_t port) |
|
void | non_blocking () |
|
void | blocking () |
|
bool | is_blocking () const |
|
void | eol (Mode mode) |
|
Mode | eol () const |
|
virtual int | putchar (char c) |
|
virtual int | puts (const char *s) |
|
virtual int | puts (str_P s) |
|
virtual int | peekchar () |
|
virtual int | peekchar (char c) |
|
virtual char * | gets (char *s, size_t count) |
|
virtual void | empty () |
|
|
virtual int | write (const void *buf, size_t size, bool progmem) |
|
virtual int | send (const void *buf, size_t len, bool progmem) |
|
virtual int | send (const void *buf, size_t len, uint8_t dest[4], uint16_t port, bool progmem) |
|
CC3000 Single-Chip Internet-enable WiFi Driver. Implements the Cosa/Socket interface.
Definition at line 44 of file CC3000.hh.
Socket type.
Enumerator |
---|
TCP |
|
UDP |
|
IPRAW |
|
MACRAW |
|
PPPoE |
|
Definition at line 37 of file Socket.hh.
CC3000::Driver::Driver |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 48 of file CC3000.hh.
int CC3000::Driver::accept |
( |
| ) |
|
|
virtual |
Check for incoming requests from clients. Return zero if the socket has accepted a request and a connection is established.
- Returns
- zero if successful otherwise negative error code.
Implements Socket.
Definition at line 183 of file CC3000.cpp.
int CC3000::Driver::available |
( |
| ) |
|
|
virtual |
Returns true if data is available in receiver buffer otherwise false.
- Returns
- bool.
Reimplemented from IOStream::Device.
Definition at line 127 of file CC3000.cpp.
void IOStream::Device::blocking |
( |
| ) |
|
|
inlineinherited |
int CC3000::Driver::close |
( |
| ) |
|
|
virtual |
Close the socket.
- Returns
- zero if successful otherwise negative error code.
Implements Socket.
Definition at line 171 of file CC3000.cpp.
int CC3000::Driver::connect |
( |
uint8_t |
addr[4], |
|
|
uint16_t |
port |
|
) |
| |
|
virtual |
Connect the socket to the given address and port; client mode.
- Parameters
-
[in] | addr | destination address. |
[in] | port | destination port. |
- Returns
- zero if successful otherwise negative error code.
Implements Socket.
Definition at line 189 of file CC3000.cpp.
int CC3000::Driver::connect |
( |
const char * |
hostname, |
|
|
uint16_t |
port |
|
) |
| |
|
virtual |
Connect the socket to the given hostname and port; client mode. Returns zero if connection established otherwise negative error code.
- Parameters
-
[in] | hostname | string. |
[in] | port | destination port. |
- Returns
- zero if successful otherwise negative error code.
Implements Socket.
Definition at line 195 of file CC3000.cpp.
int CC3000::Driver::datagram |
( |
uint8_t |
addr[4], |
|
|
uint16_t |
port |
|
) |
| |
|
virtual |
Start the construction of a datagram to the given address and port.
- Parameters
-
[in] | addr | destination address. |
[in] | port | destination port. |
- Returns
- zero if successful otherwise negative error code.
Implements Socket.
Definition at line 215 of file CC3000.cpp.
int CC3000::Driver::disconnect |
( |
| ) |
|
|
virtual |
Disconnect socket from server.
- Returns
- zero if successful otherwise negative error code.
Implements Socket.
Definition at line 209 of file CC3000.cpp.
void IOStream::Device::empty |
( |
| ) |
|
|
virtualinherited |
void IOStream::Device::eol |
( |
Mode |
mode | ) |
|
|
inlineinherited |
Set end of line mode.
- Parameters
-
Definition at line 103 of file IOStream.hh.
Mode IOStream::Device::eol |
( |
| ) |
const |
|
inlineinherited |
Get end of line mode.
- Returns
- mode.
Definition at line 112 of file IOStream.hh.
int CC3000::Driver::flush |
( |
| ) |
|
|
virtual |
Flush internal device buffers. Wait for device to become idle.
- Returns
- zero(0) or negative error code.
Reimplemented from IOStream::Device.
Definition at line 155 of file CC3000.cpp.
virtual int Socket::getchar |
( |
| ) |
|
|
inlinevirtualinherited |
char * IOStream::Device::gets |
( |
char * |
s, |
|
|
size_t |
count |
|
) |
| |
|
virtualinherited |
Read string terminated by new-line or until size into given string buffer. Returns pointer to string or NULL if empty line.
- Parameters
-
[in] | s | string buffer to read into. |
[in] | count | max number of bytes to read. |
- Returns
- string pointer or NULL.
Definition at line 118 of file IOStream_Device.cpp.
bool IOStream::Device::is_blocking |
( |
| ) |
const |
|
inlineinherited |
Is blocking mode?
- Returns
- bool.
Definition at line 94 of file IOStream.hh.
int CC3000::Driver::is_connected |
( |
| ) |
|
|
virtual |
Returns positive integer if a connection is established, zero is not yet established, otherwise a negative error code.
- Returns
- positive integer connected, zero if not otherwise negative error code.
Implements Socket.
Definition at line 203 of file CC3000.cpp.
int CC3000::Driver::listen |
( |
| ) |
|
|
virtual |
Mark socket for incoming requests; server mode.
- Returns
- zero if successful otherwise negative error code.
Implements Socket.
Definition at line 177 of file CC3000.cpp.
void IOStream::Device::non_blocking |
( |
| ) |
|
|
inlineinherited |
Set non-blocking mode.
Definition at line 77 of file IOStream.hh.
int CC3000::Driver::open |
( |
Protocol |
proto, |
|
|
uint16_t |
port, |
|
|
uint8_t |
flag |
|
) |
| |
|
virtual |
Initiate socket to the given protocol and possible port.
- Parameters
-
[in] | proto | protocol. |
[in] | port | source port. |
[in] | flag | socket options. |
- Returns
- zero if successful otherwise negative error code.
Implements Socket.
Definition at line 162 of file CC3000.cpp.
int IOStream::Device::peekchar |
( |
| ) |
|
|
virtualinherited |
int IOStream::Device::peekchar |
( |
char |
c | ) |
|
|
virtualinherited |
Peek for the given character in device buffer. Return number of characters or EOF(-1).
- Parameters
-
[in] | c | character to peek for. |
- Returns
- available or EOF(-1).
Reimplemented in Soft::UART, UART, and IOBuffer< SIZE >.
Definition at line 105 of file IOStream_Device.cpp.
uint16_t Socket::port |
( |
| ) |
const |
|
inlineinherited |
Get socket port.
- Returns
- port.
Definition at line 78 of file Socket.hh.
Get socket protocol.
- Returns
- protocol.
Definition at line 69 of file Socket.hh.
int IOStream::Device::putchar |
( |
char |
c | ) |
|
|
virtualinherited |
Write character to device.
- Parameters
-
- Returns
- character written or EOF(-1).
Reimplemented in FAT16::File, HD44780, ST7565, PCD8544, MAX72XX, VLCD, UART, Textbox, IOBuffer< SIZE >, RS485, WIO, and Soft::UAT.
Definition at line 36 of file IOStream_Device.cpp.
int IOStream::Device::puts |
( |
const char * |
s | ) |
|
|
virtualinherited |
Write null terminated string to device. Terminating null is not written.
- Parameters
-
- Returns
- zero(0) or negative error code.
Definition at line 43 of file IOStream_Device.cpp.
int IOStream::Device::puts |
( |
str_P |
s | ) |
|
|
virtualinherited |
Write null terminated string from program memory to device. Terminating null is not written.
- Parameters
-
[in] | s | string in program memory to write. |
- Returns
- zero(0) or negative error code.
Definition at line 54 of file IOStream_Device.cpp.
int CC3000::Driver::read |
( |
void * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Read data to given buffer with given size from device.
- Parameters
-
[in] | buf | buffer to read into. |
[in] | size | number of bytes to read. |
- Returns
- number of bytes read or EOF(-1).
Reimplemented from Socket.
Definition at line 146 of file CC3000.cpp.
int IOStream::Device::read |
( |
iovec_t * |
vec | ) |
|
|
virtualinherited |
Read data to given buffers in null terminated io vector.
- Parameters
-
[in] | vec | io vector with buffers to read into. |
- Returns
- number of bytes read or EOF(-1).
Definition at line 157 of file IOStream_Device.cpp.
int CC3000::Driver::recv |
( |
void * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
virtual |
Receive data from connection-oriented socket. The data is stored in given buffer with given maximum number of bytes. Return number of bytes or negative error code.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | len | number of bytes in buffer. |
- Returns
- number of bytes sent if successful otherwise negative error code.
Implements Socket.
Definition at line 223 of file CC3000.cpp.
int CC3000::Driver::recv |
( |
void * |
buf, |
|
|
size_t |
len, |
|
|
uint8_t |
src[4], |
|
|
uint16_t & |
port |
|
) |
| |
|
virtual |
Receive datagram on connectionless socket into given buffer with given maximum size. Returns zero(0) if successful with information in Datagram otherwise negative error code.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | len | number of bytes in buffer. |
[in] | src | source address. |
[in] | port | source port. |
- Returns
- number of bytes received if successful otherwise negative error code.
Implements Socket.
Definition at line 229 of file CC3000.cpp.
int CC3000::Driver::room |
( |
| ) |
|
|
virtual |
Number of bytes room in transmitter buffer before full will be sent.
- Returns
- bytes.
Reimplemented from IOStream::Device.
Definition at line 139 of file CC3000.cpp.
int Socket::send |
( |
const void * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inlineinherited |
Send given data in buffer on connection-oriented socket. Return number of bytes or negative error code.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | len | number of bytes in buffer. |
- Returns
- number of bytes sent if successful otherwise negative error code.
Definition at line 222 of file Socket.hh.
int CC3000::Driver::send |
( |
const void * |
buf, |
|
|
size_t |
len, |
|
|
bool |
progmem |
|
) |
| |
|
protectedvirtual |
Send given data in buffer on connection-oriented socket. Boolean flag progmem defined if the buffer is in program memory. Return number of bytes or negative error code.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | len | number of bytes in buffer. |
[in] | progmem | program memory pointer flag. |
- Returns
- number of bytes sent if successful otherwise negative error code.
Implements Socket.
Definition at line 248 of file CC3000.cpp.
int CC3000::Driver::send |
( |
const void * |
buf, |
|
|
size_t |
len, |
|
|
uint8_t |
dest[4], |
|
|
uint16_t |
port, |
|
|
bool |
progmem |
|
) |
| |
|
protectedvirtual |
Send given data on connectionless socket as a datagram to given destination address (dest:port). Return number of bytes sent or negative error code.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | len | number of bytes in buffer. |
[in] | dest | destination address. |
[in] | port | destination port. |
[in] | progmem | program memory pointer flag. |
- Returns
- number of bytes sent if successful otherwise negative error code.
Implements Socket.
Definition at line 255 of file CC3000.cpp.
int Socket::send |
( |
const void * |
buf, |
|
|
size_t |
len, |
|
|
uint8_t |
dest[4], |
|
|
uint16_t |
port |
|
) |
| |
|
inlineinherited |
Send given data in buffer on connectionless socket as a datagram to given destination address (dest:port). Return number of bytes sent or negative error code.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | len | number of bytes in buffer. |
[in] | dest | destination address. |
[in] | port | destination port. |
- Returns
- number of bytes sent if successful otherwise negative error code.
Definition at line 264 of file Socket.hh.
int Socket::send_P |
( |
const void * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inlineinherited |
Send given data in program memory buffer on connection-oriented socket. Return number of bytes or negative error code.
- Parameters
-
[in] | buf | program memory pointer. |
[in] | len | number of bytes in buffer. |
- Returns
- number of bytes sent if successful otherwise negative error code.
Definition at line 236 of file Socket.hh.
int Socket::send_P |
( |
const void * |
buf, |
|
|
size_t |
len, |
|
|
uint8_t |
dest[4], |
|
|
uint16_t |
port |
|
) |
| |
|
inlineinherited |
Send given data in program memory buffer on connectionless socket as a datagram to given destination address (dest:port). Return number of bytes sent or negative error code.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | len | number of bytes in buffer. |
[in] | dest | destination address. |
[in] | port | destination port. |
- Returns
- number of bytes sent if successful otherwise negative error code.
Definition at line 281 of file Socket.hh.
Get source machine address, network address and port.
- Parameters
-
[out] | addr | network address. |
Definition at line 60 of file Socket.hh.
virtual int CC3000::Driver::write |
( |
const void * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
inlinevirtual |
Write data from buffer with given size to device.
- Parameters
-
[in] | buf | buffer to write. |
[in] | size | number of bytes to write. |
- Returns
- number of bytes written or EOF(-1).
Reimplemented from Socket.
Definition at line 74 of file CC3000.hh.
int IOStream::Device::write |
( |
const iovec_t * |
vec | ) |
|
|
virtualinherited |
Write data from buffers in null terminated io vector.
- Parameters
-
[in] | vec | io vector with buffers to write. |
- Returns
- number of bytes written or EOF(-1).
Definition at line 87 of file IOStream_Device.cpp.
int CC3000::Driver::write |
( |
const void * |
buf, |
|
|
size_t |
size, |
|
|
bool |
progmem |
|
) |
| |
|
protectedvirtual |
Write data from buffer with given size to device. Boolean flag progmem defined if the buffer is in program memory. Return number of bytes or negative error code.
- Parameters
-
[in] | buf | buffer to write. |
[in] | size | number of bytes to write. |
[in] | progmem | program memory pointer flag. |
- Returns
- number of bytes written or EOF(-1).
Reimplemented from Socket.
Definition at line 239 of file CC3000.cpp.
virtual int CC3000::Driver::write_P |
( |
const void * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
inlinevirtual |
Write data from buffer in program memory with given size to device.
- Parameters
-
[in] | buf | buffer to write. |
[in] | size | number of bytes to write. |
- Returns
- number of bytes written or EOF(-1).
Reimplemented from Socket.
Definition at line 86 of file CC3000.hh.
const uint16_t Socket::DYNAMIC_PORT = 49152 |
|
staticinherited |
First dynamic, private or ephemeral port number.
Definition at line 34 of file Socket.hh.
bool IOStream::Device::m_blocking |
|
protectedinherited |
Mode IOStream::Device::m_eol |
|
protectedinherited |
uint8_t CC3000::Driver::m_hndl |
|
protected |
uint8_t CC3000::Driver::m_ip[4] |
|
protected |
int CC3000::Driver::m_port |
|
protected |
Source address; MAC, IP and port.
Definition at line 302 of file Socket.hh.
The documentation for this class was generated from the following files: