Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of cc3000_hostdriver_mbedsocket by
cc3000 Class Reference
The main object of cc3000 implementation. More...
#include <cc3000.h>
Data Structures | |
| struct | tStatus |
| status structure More... | |
Public Member Functions | |
| cc3000 (PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, uint32_t max_tx_size=1520, uint32_t max_rx_size=512) | |
| Ctor. | |
| ~cc3000 () | |
| Dtor. | |
| void | start (uint8_t patch) |
| Initiate cc3000. | |
| void | stop () |
| Stops the wlan communication. | |
| void | restart (uint8_t patch) |
| Restarts the wlan communication. | |
| void | usync_callback (int32_t event_type, uint8_t *data, uint8_t length) |
| Callback which is called from the event class. | |
| bool | connect_non_blocking (const uint8_t *ssid, const uint8_t *key, int32_t security_mode) |
| Start connection to SSID (open/secured) non-blocking. | |
| bool | connect_to_AP (const uint8_t *ssid, const uint8_t *key, int32_t security_mode) |
| Connect to SSID (open/secured) with timeout (10s). | |
| bool | connect_secure (const uint8_t *ssid, const uint8_t *key, int32_t security_mode) |
| Connect to SSID which is secured. | |
| bool | connect_open (const uint8_t *ssid) |
| Connect to SSID which is open (no security) | |
| bool | is_enabled () |
| Status of the cc3000 module. | |
| bool | is_connected () |
| Status of the cc3000 connection. | |
| bool | is_dhcp_configured () |
| Status of DHCP. | |
| bool | is_smart_confing_completed () |
| Status of smart confing completation. | |
| uint8_t | get_mac_address (uint8_t address[6]) |
| Return the cc3000's mac address. | |
| uint8_t | set_mac_address (uint8_t address[6]) |
| Set the cc3000's mac address. | |
| void | get_user_file_info (uint8_t *info_file, size_t size) |
| Get user file info. | |
| void | set_user_file_info (uint8_t *info_file, size_t size) |
| Set user filo info. | |
| void | start_smart_config (const uint8_t *smart_config_key) |
| Start smart config. | |
| bool | get_ip_config (tNetappIpconfigRetArgs *ip_config) |
| Return ip configuration. | |
| void | delete_profiles (void) |
| Delete all stored profiles. | |
| uint32_t | ping (uint32_t ip, uint8_t attempts, uint16_t timeout, uint8_t size) |
| Ping an ip address. | |
| cc3000 (PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, const char *ssid, const char *phrase, Security sec, bool smart_config, uint32_t max_tx_size=1520, uint32_t max_rx_size=512) | |
| Ctor for EthernetInterface. | |
| int | disconnect () |
| Disconnect wlan device. | |
| void | init () |
| Initialize the interface with DHCP. | |
| void | init (const char *ip, const char *mask, const char *gateway) |
| Initialize the interface with a static IP address. | |
| int | connect (unsigned int timeout_ms=20000) |
| Connect Bring the interface up. | |
| char * | getMACAddress () |
| Get the MAC address of your Ethernet interface. | |
| char * | getIPAddress () |
| Get the IP address of your Ethernet interface. | |
| uint8_t | read_sp_version (uint8_t firmware[2]) |
| Return the CC3000's firmware version. | |
| uint8_t | write_patch (uint32_t file_id, uint32_t length, const uint8_t *data) |
| routine to update firmware of CC3000 | |
| char * | getGateway () |
| Get the Gateway address of your Ethernet interface. | |
| char * | getNetworkMask () |
| Get the Network mask of your Ethernet interface. | |
Static Public Member Functions | |
| static cc3000 * | get_instance () |
| Returns cc3000 instance. | |
Detailed Description
The main object of cc3000 implementation.
Definition at line 1549 of file cc3000.h.
Constructor & Destructor Documentation
| cc3000 | ( | PinName | cc3000_irq, |
| PinName | cc3000_en, | ||
| PinName | cc3000_cs, | ||
| SPI | cc3000_spi, | ||
| uint32_t | max_tx_size = 1520, |
||
| uint32_t | max_rx_size = 512 |
||
| ) |
Ctor.
- Parameters:
-
cc3000_irq IRQ pin cc3000_en Enable pin cc3000_cs Chip select pin cc3000_spi SPI interface max_tx_size TX buffer size (optional, default = 1520) max_rx_size RX buffer size (optional, default = 512)
Definition at line 50 of file cc3000.cpp.
| ~cc3000 | ( | ) |
Dtor.
Definition at line 61 of file cc3000.cpp.
| cc3000 | ( | PinName | cc3000_irq, |
| PinName | cc3000_en, | ||
| PinName | cc3000_cs, | ||
| SPI | cc3000_spi, | ||
| const char * | ssid, | ||
| const char * | phrase, | ||
| Security | sec, | ||
| bool | smart_config, | ||
| uint32_t | max_tx_size = 1520, |
||
| uint32_t | max_rx_size = 512 |
||
| ) |
Ctor for EthernetInterface.
- Parameters:
-
cc3000_irq IRQ pin cc3000_en Enable pin cc3000_cs Chip select pin cc3000_spi SPI interface ssid SSID phrase Password sec Security of the AP smart_config Smart config selection max_tx_size TX buffer size (optional, default = 1520) max_rx_size RX buffer size (optional, default = 512)
Definition at line 65 of file cc3000.cpp.
Member Function Documentation
| int connect | ( | unsigned int | timeout_ms = 20000 ) |
Connect Bring the interface up.
- Parameters:
-
timeout_ms timeout in ms
- Returns:
- 0 if successful, -1 otherwise.
Definition at line 114 of file cc3000.cpp.
| bool connect_non_blocking | ( | const uint8_t * | ssid, |
| const uint8_t * | key, | ||
| int32_t | security_mode | ||
| ) |
Start connection to SSID (open/secured) non-blocking.
- Parameters:
-
ssid SSID name key Security key (if key = 0, open connection) security_mode Security mode
- Returns:
- true if connection was established, false otherwise.
Definition at line 319 of file cc3000.cpp.
| bool connect_open | ( | const uint8_t * | ssid ) |
Connect to SSID which is open (no security)
- Parameters:
-
ssid SSID name
- Returns:
- true if connection was established, false otherwise.
Definition at line 390 of file cc3000.cpp.
| bool connect_secure | ( | const uint8_t * | ssid, |
| const uint8_t * | key, | ||
| int32_t | security_mode | ||
| ) |
Connect to SSID which is secured.
- Parameters:
-
ssid SSID name key Security key security_mode Security mode
- Returns:
- true if connection was established, false otherwise.
Definition at line 301 of file cc3000.cpp.
| bool connect_to_AP | ( | const uint8_t * | ssid, |
| const uint8_t * | key, | ||
| int32_t | security_mode | ||
| ) |
Connect to SSID (open/secured) with timeout (10s).
- Parameters:
-
ssid SSID name key Security key (if key = 0, open connection) security_mode Security mode
- Returns:
- true if connection was established, false otherwise.
Definition at line 340 of file cc3000.cpp.
| void delete_profiles | ( | void | ) |
Delete all stored profiles.
- Parameters:
-
none
- Returns:
- none
Definition at line 462 of file cc3000.cpp.
| int disconnect | ( | void | ) |
Disconnect wlan device.
- Parameters:
-
none
- Returns:
- 0 if successful, -1 otherwise.
Definition at line 182 of file cc3000.cpp.
| static cc3000* get_instance | ( | ) | [static] |
| bool get_ip_config | ( | tNetappIpconfigRetArgs * | ip_config ) |
Return ip configuration.
- Parameters:
-
ip_config Pointer to ipconfig data.
- Returns:
- true if it's connected and info was retrieved, false otherwise.
Definition at line 452 of file cc3000.cpp.
| uint8_t get_mac_address | ( | uint8_t | address[6] ) |
Return the cc3000's mac address.
- Parameters:
-
address Retreived mac address.
- Returns:
Definition at line 428 of file cc3000.cpp.
| void get_user_file_info | ( | uint8_t * | info_file, |
| size_t | size | ||
| ) |
Get user file info.
- Parameters:
-
info_file Pointer where info will be stored. size Available size.
- Returns:
- none
Definition at line 436 of file cc3000.cpp.
| char * getGateway | ( | ) |
Get the Gateway address of your Ethernet interface.
- Parameters:
-
none
- Returns:
- Pointer to a string containing the Gateway address
Definition at line 174 of file cc3000.cpp.
| char * getIPAddress | ( | ) |
Get the IP address of your Ethernet interface.
- Parameters:
-
none
- Returns:
- Pointer to a string containing the IP address.
Definition at line 170 of file cc3000.cpp.
| char * getMACAddress | ( | ) |
Get the MAC address of your Ethernet interface.
- Parameters:
-
none
- Returns:
- Pointer to a string containing the MAC address.
Definition at line 166 of file cc3000.cpp.
| char * getNetworkMask | ( | ) |
Get the Network mask of your Ethernet interface.
- Parameters:
-
none
- Returns:
- Pointer to a string containing the Network mask
Definition at line 178 of file cc3000.cpp.
| void init | ( | const char * | ip, |
| const char * | mask, | ||
| const char * | gateway | ||
| ) |
Initialize the interface with a static IP address.
- Parameters:
-
ip the IP address to use. mask the IP address mask gateway the gateway to use
- Returns:
- none
Definition at line 103 of file cc3000.cpp.
| void init | ( | ) |
Initialize the interface with DHCP.
- Parameters:
-
none
- Returns:
- none
Definition at line 86 of file cc3000.cpp.
| bool is_connected | ( | ) |
Status of the cc3000 connection.
- Returns:
- true if it's connected, false otherwise.
Definition at line 412 of file cc3000.cpp.
| bool is_dhcp_configured | ( | ) |
Status of DHCP.
- Parameters:
-
none
- Returns:
- true if DCHP is configured, false otherwise.
Definition at line 420 of file cc3000.cpp.
| bool is_enabled | ( | ) |
Status of the cc3000 module.
- Returns:
- true if it's enabled, false otherwise.
Definition at line 407 of file cc3000.cpp.
| bool is_smart_confing_completed | ( | ) |
Status of smart confing completation.
- Parameters:
-
none
- Returns:
- smart config was set, false otherwise.
Definition at line 424 of file cc3000.cpp.
| uint32_t ping | ( | uint32_t | ip, |
| uint8_t | attempts, | ||
| uint16_t | timeout, | ||
| uint8_t | size | ||
| ) |
Ping an ip address.
- Parameters:
-
ip Destination IP address attempts Number of attempts timeout Time to wait for a response,in milliseconds. size Send buffer size which may be up to 1400 bytes
Definition at line 476 of file cc3000.cpp.
| uint8_t read_sp_version | ( | uint8_t | firmware[2] ) |
Return the CC3000's firmware version.
- Parameters:
-
firmware Retreived firmware version.
- Returns:
- 0 if successful, -1 otherwise.
Definition at line 440 of file cc3000.cpp.
| void restart | ( | uint8_t | patch ) |
Restarts the wlan communication.
Definition at line 382 of file cc3000.cpp.
| uint8_t set_mac_address | ( | uint8_t | address[6] ) |
Set the cc3000's mac address.
- Parameters:
-
address Mac address to be set.
- Returns:
Definition at line 432 of file cc3000.cpp.
| void set_user_file_info | ( | uint8_t * | info_file, |
| size_t | size | ||
| ) |
Set user filo info.
- Parameters:
-
info_file Pointer to user's info.
- Returns:
- none
Definition at line 472 of file cc3000.cpp.
| void start | ( | uint8_t | patch ) |
Initiate cc3000.
It starts the wlan communication.
- Parameters:
-
patch Patch
Definition at line 371 of file cc3000.cpp.
| void start_smart_config | ( | const uint8_t * | smart_config_key ) |
Start smart config.
- Parameters:
-
smart_config_key Pointer to smart config key.
- Returns:
- none
Definition at line 249 of file cc3000.cpp.
| void stop | ( | void | ) |
Stops the wlan communication.
Definition at line 377 of file cc3000.cpp.
| void usync_callback | ( | int32_t | event_type, |
| uint8_t * | data, | ||
| uint8_t | length | ||
| ) |
Callback which is called from the event class.
This updates status of cc3000.
- Parameters:
-
event_type Type of the event data Pointer to data length Length of data
- Returns:
- none
Definition at line 192 of file cc3000.cpp.
| uint8_t write_patch | ( | uint32_t | file_id, |
| uint32_t | length, | ||
| const uint8_t * | data | ||
| ) |
routine to update firmware of CC3000
- Parameters:
-
\return 0 if successful, -1 otherwise.
Definition at line 444 of file cc3000.cpp.
Generated on Fri Jul 15 2022 02:23:47 by
1.7.2
