|
Open Model Railroad Network (OpenMRN)
|
#include "CC32xxWiFi.hxx"#include "CC32xxSocket.hxx"#include "freertos_drivers/common/WifiDefs.hxx"#include "freertos_drivers/ti/CC32xxHelper.hxx"#include "utils/format_utils.hxx"#include "utils/logging.h"#include <unistd.h>#include <ti/drivers/net/wifi/simplelink.h>#include <ti/drivers/net/wifi/source/protocol.h>Go to the source code of this file.
Classes | |
| struct | CC32xxWiFi::WlanEvent |
| CC32xx forward declaration Helper. More... | |
| struct | CC32xxWiFi::NetAppEvent |
| CC32xx forward declaration Helper. More... | |
| struct | CC32xxWiFi::SockEvent |
| CC32xx forward declaration Helper. More... | |
| struct | CC32xxWiFi::SockTriggerEvent |
| CC32xx forward declaration Helper. More... | |
| struct | CC32xxWiFi::HttpServerEvent |
| CC32xx forward declaration Helper. More... | |
| struct | CC32xxWiFi::HttpServerResponse |
| CC32xx forward declaration Helper. More... | |
| struct | CC32xxWiFi::NetAppRequest |
| CC32xx forward declaration Helper. More... | |
| struct | CC32xxWiFi::NetAppResponse |
| CC32xx forward declaration Helper. More... | |
| struct | CC32xxWiFi::FatalErrorEvent |
| CC32xx forward declaration Helper. More... | |
Macros | |
| #define | SUPPORT_SL_R1_API |
| #define | CHANNEL_MASK_ALL 0x1FFF |
| #define | RSSI_TH_MAX -95 |
Functions | |
| void | new_highest () |
| Find the new highest fd to select on. | |
| void | add_socket (int16_t sd) |
| Add an interesting socket. | |
| void | del_socket (int16_t sd) |
| Delete an interesting socket. | |
| static void | append_num (std::string *s, uint32_t d) |
| template<class NUM > | |
| static void | append_ver_4 (std::string *s, NUM d[4]) |
| void | mdns_publish (const char *name, const char *service, uint16_t port) |
| Publish an mDNS name. | |
| void | mdns_unpublish (const char *name, const char *service) |
| Unpublish an mDNS name. | |
| void | SimpleLinkWlanEventHandler (SlWlanEvent_t *pSlWlanEvent) |
| This function handles WLAN events. | |
| void | SimpleLinkNetAppEventHandler (SlNetAppEvent_t *pNetAppEvent) |
| This function handles network events such as IP acquisition, IP leased, IP released etc. | |
| void | SimpleLinkGeneralEventHandler (SlDeviceEvent_t *pDevEvent) |
| This function handles general events. | |
| void | SimpleLinkSockEventHandler (SlSockEvent_t *pSock) |
| This function handles socket events indication. | |
| void | SimpleLinkHttpServerEventHandler (SlNetAppHttpServerEvent_t *pHttpServerEvent, SlNetAppHttpServerResponse_t *pHttpServerResponse) |
| This function gets triggered when HTTP Server receives Application defined GET and POST HTTP Tokens. | |
| void | SimpleLinkNetAppRequestEventHandler (SlNetAppRequest_t *pNetAppRequest, SlNetAppResponse_t *pNetAppResponse) |
| This function handles resource request. | |
| void | SimpleLinkNetAppRequestMemFreeEventHandler (uint8_t *buffer) |
| This function handles resource release. | |
| void | SimpleLinkFatalErrorEventHandler (SlDeviceFatal_t *slFatalErrorEvent) |
| This Function Handles the Fatal errors. | |
| void | SimpleLinkSocketTriggerEventHandler (SlSockTriggerEvent_t *event) |
| Notifies the service about a wifi asynchronous socket event callback. | |
| int | slcb_SetErrno (int Errno) |
| Helper function called by SimpleLink driver to set OS-specific errno value. | |
Variables | |
| static SlFdSet_t | rfds |
| This is not a class members so that including CC32xxWiFi.hxx does not pollute the namespace with simplelink APIs. | |
| static SlFdSet_t | wfds |
| This is not a class members so that including CC32xxWiFi.hxx does not pollute the namespace with simplelink APIs. | |
| static SlFdSet_t | efds |
| This is not a class members so that including CC32xxWiFi.hxx does not pollute the namespace with simplelink APIs. | |
| static int | fdHighest |
| the highest file descriptor to select on | |
| static int16_t | slSockets [SL_MAX_SOCKETS] |
| This is not a class members so that including CC32xxWiFi.hxx does not pollute the namespace with simplelink APIs. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This file instantiates and initializes the CC32xx Wi-Fi.
Definition in file net_cc3220/CC32xxWiFi.cxx.
| #define SUPPORT_SL_R1_API |
Definition at line 36 of file net_cc3220/CC32xxWiFi.cxx.
| void add_socket | ( | int16_t | sd | ) |
Add an interesting socket.
| sd | number to add |
Definition at line 138 of file net_cc3220/CC32xxWiFi.cxx.
|
static |
Definition at line 1589 of file net_cc3220/CC32xxWiFi.cxx.
|
static |
Definition at line 1597 of file net_cc3220/CC32xxWiFi.cxx.
| void del_socket | ( | int16_t | sd | ) |
Delete an interesting socket.
@parqam sd number to delete
Definition at line 165 of file net_cc3220/CC32xxWiFi.cxx.
| void mdns_publish | ( | const char * | name, |
| const char * | service, | ||
| uint16_t | port | ||
| ) |
Publish an mDNS name.
| name | local "username" or "nodename" of the service |
| service | service name, example: "_openlcb._tcp" |
| port | port number |
Definition at line 1639 of file net_cc3220/CC32xxWiFi.cxx.
| void mdns_unpublish | ( | const char * | name, |
| const char * | service | ||
| ) |
Unpublish an mDNS name.
| name | local "username" or "nodename" of the service |
| service | service name, example: "_openlcb._tcp" |
Definition at line 1653 of file net_cc3220/CC32xxWiFi.cxx.
| void new_highest | ( | ) |
Find the new highest fd to select on.
Definition at line 115 of file net_cc3220/CC32xxWiFi.cxx.
| void SimpleLinkFatalErrorEventHandler | ( | SlDeviceFatal_t * | slFatalErrorEvent | ) |
This Function Handles the Fatal errors.
| slFatalErrorEvent | - Contains the fatal error data |
Definition at line 1752 of file net_cc3220/CC32xxWiFi.cxx.
| void SimpleLinkGeneralEventHandler | ( | SlDeviceEvent_t * | pDevEvent | ) |
This function handles general events.
| pDevEvent | pointer to General Event Info |
Definition at line 1687 of file net_cc3220/CC32xxWiFi.cxx.
| void SimpleLinkHttpServerEventHandler | ( | SlNetAppHttpServerEvent_t * | pHttpServerEvent, |
| SlNetAppHttpServerResponse_t * | pHttpServerResponse | ||
| ) |
This function gets triggered when HTTP Server receives Application defined GET and POST HTTP Tokens.
| pSlHttpServerEvent | pointer indicating http server event |
| pSlHttpServerResponse | pointer indicating http server response |
Definition at line 1706 of file net_cc3220/CC32xxWiFi.cxx.
| void SimpleLinkNetAppEventHandler | ( | SlNetAppEvent_t * | pNetAppEvent | ) |
This function handles network events such as IP acquisition, IP leased, IP released etc.
| pNetAppEvent | pointer indicating device acquired IP |
Definition at line 1678 of file net_cc3220/CC32xxWiFi.cxx.
| void SimpleLinkNetAppRequestEventHandler | ( | SlNetAppRequest_t * | pNetAppRequest, |
| SlNetAppResponse_t * | pNetAppResponse | ||
| ) |
This function handles resource request.
| [in] | pNetAppRequest | - Contains the resource requests |
| [in] | pNetAppResponse | - Should be filled by the user with the relevant response information |
Definition at line 1722 of file net_cc3220/CC32xxWiFi.cxx.
| void SimpleLinkNetAppRequestMemFreeEventHandler | ( | uint8_t * | buffer | ) |
This function handles resource release.
| [in] | buffer | - Contains the resource requests |
| [in] | pNetAppResponse | - Should be filled by the user with the relevant response information |
Definition at line 1743 of file net_cc3220/CC32xxWiFi.cxx.
| void SimpleLinkSocketTriggerEventHandler | ( | SlSockTriggerEvent_t * | event | ) |
Notifies the service about a wifi asynchronous socket event callback.
This means that sl_Select needs to be re-run and certain sockets might need wakeup.
| event | parameters from the socket. |
Definition at line 1762 of file net_cc3220/CC32xxWiFi.cxx.
| void SimpleLinkSockEventHandler | ( | SlSockEvent_t * | pSock | ) |
This function handles socket events indication.
| pSock | pointer to Socket Event Info |
Definition at line 1695 of file net_cc3220/CC32xxWiFi.cxx.
| void SimpleLinkWlanEventHandler | ( | SlWlanEvent_t * | pSlWlanEvent | ) |
This function handles WLAN events.
| pSlWlanEvent | pointer to WLAN Event Info |
Definition at line 1668 of file net_cc3220/CC32xxWiFi.cxx.
|
extern |
Helper function called by SimpleLink driver to set OS-specific errno value.
The implementation just forwards the errno value to the newlib_nano errno value.
| Errno | is the new value to be written to errno. |
Definition at line 1775 of file net_cc3220/CC32xxWiFi.cxx.
|
static |
This is not a class members so that including CC32xxWiFi.hxx does not pollute the namespace with simplelink APIs.
Definition at line 92 of file net_cc3220/CC32xxWiFi.cxx.
|
static |
the highest file descriptor to select on
Definition at line 95 of file net_cc3220/CC32xxWiFi.cxx.
|
static |
This is not a class members so that including CC32xxWiFi.hxx does not pollute the namespace with simplelink APIs.
Definition at line 82 of file net_cc3220/CC32xxWiFi.cxx.
|
static |
This is not a class members so that including CC32xxWiFi.hxx does not pollute the namespace with simplelink APIs.
slSockets keeps track of all the possible CC32x sockets. On the CC3200, SL_MAX_SOCKETS is 8. On the CC3220, SL_MAX_SOCKETS is 16. Unused slots will have a value of -1, which is initialized in the CC32xxWifi class constructor. If a socket becomes interesting (is added to a select() call list), it will be added to an open slot in slSockets by its CC32xx socket descriptor space value. When a socket is closed, it is removed from the from slSockets and the resulting empty slot is returned to a value of -1.
Note: not all socket descriptors will be added to slSockets for tracking. Only those sockets which are added to a select() call list will be tracked by slSockets.
Definition at line 111 of file net_cc3220/CC32xxWiFi.cxx.
|
static |
This is not a class members so that including CC32xxWiFi.hxx does not pollute the namespace with simplelink APIs.
Definition at line 87 of file net_cc3220/CC32xxWiFi.cxx.