Standardize the width of all comment boxes in C files

This commit is contained in:
Gregory Nutt
2015-10-03 07:25:53 -06:00
parent 0f90500f72
commit 16b32bbadd
38 changed files with 658 additions and 658 deletions
+14 -14
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* cc3000_common.c.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,15 +30,15 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
/******************************************************************************
****************************************************************************/
/****************************************************************************
* Included files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
/*****************************************************************************
/****************************************************************************
* Name:__error__
*
* Description:
@@ -51,9 +51,9 @@
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: UINT32_TO_STREAM_f
*
* Description:
@@ -67,7 +67,7 @@
* Returned Value:
* Pointer to the new stream
*
*****************************************************************************/
****************************************************************************/
uint8_t *UINT32_TO_STREAM_f(uint8_t *p, unsigned long u32)
{
@@ -78,7 +78,7 @@ uint8_t *UINT32_TO_STREAM_f(uint8_t *p, unsigned long u32)
return p;
}
/*****************************************************************************
/****************************************************************************
* Name: UINT16_TO_STREAM_f
*
* Description:
@@ -92,7 +92,7 @@ uint8_t *UINT32_TO_STREAM_f(uint8_t *p, unsigned long u32)
* Returned Value:
* Pointer to the new stream
*
*****************************************************************************/
****************************************************************************/
uint8_t *UINT16_TO_STREAM_f(uint8_t *p, uint16_t u16)
{
@@ -101,7 +101,7 @@ uint8_t *UINT16_TO_STREAM_f(uint8_t *p, uint16_t u16)
return p;
}
/*****************************************************************************
/****************************************************************************
* Name: STREAM_TO_UINT16_f
*
* Description:
@@ -115,7 +115,7 @@ uint8_t *UINT16_TO_STREAM_f(uint8_t *p, uint16_t u16)
* Returned Value:
* Pointer to the new 16 bit
*
*****************************************************************************/
****************************************************************************/
uint16_t STREAM_TO_UINT16_f(char* p, uint16_t offset)
{
@@ -123,7 +123,7 @@ uint16_t STREAM_TO_UINT16_f(char* p, uint16_t offset)
(*(p + offset + 1)) << 8) + (uint16_t)(*(p + offset)));
}
/*****************************************************************************
/****************************************************************************
* Name: STREAM_TO_UINT32_f
*
* Description:
@@ -137,7 +137,7 @@ uint16_t STREAM_TO_UINT16_f(char* p, uint16_t offset)
* Returned Value:
* Pointer to the new 32 bit
*
*****************************************************************************/
****************************************************************************/
unsigned long STREAM_TO_UINT32_f(char* p, uint16_t offset)
{
+23 -23
View File
@@ -33,11 +33,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
@@ -57,9 +57,9 @@
#include <nuttx/wireless/cc3000.h>
#include <nuttx/wireless/cc3000/cc3000_common.h>
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
#undef SPI_DEBUG /* Define to enable debug */
#undef SPI_VERBOSE /* Define to enable verbose debug */
@@ -77,9 +77,9 @@
# define spivdbg(x...)
#endif
/*****************************************************************************
/****************************************************************************
* Private Types
*****************************************************************************/
****************************************************************************/
static struct
{
@@ -96,11 +96,11 @@ static struct
-1,
};
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: cc3000_resume
*
* Description:
@@ -112,7 +112,7 @@ static struct
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void cc3000_resume(void)
{
@@ -121,7 +121,7 @@ void cc3000_resume(void)
nllvdbg("Done\n");
}
/*****************************************************************************
/****************************************************************************
* Name: cc3000_write
*
* Description:
@@ -133,7 +133,7 @@ void cc3000_resume(void)
*
* Returned Value:
*
*****************************************************************************/
****************************************************************************/
long cc3000_write(uint8_t *pUserBuffer, uint16_t usLength)
{
@@ -141,7 +141,7 @@ long cc3000_write(uint8_t *pUserBuffer, uint16_t usLength)
return write(spiconf.cc3000fd,pUserBuffer,usLength) == usLength ? 0 : -errno;
}
/*****************************************************************************
/****************************************************************************
* Name: cc3000_read
*
* Description:
@@ -154,7 +154,7 @@ long cc3000_write(uint8_t *pUserBuffer, uint16_t usLength)
*
* Returned Value:
*
*****************************************************************************/
****************************************************************************/
long cc3000_read(uint8_t *pUserBuffer, uint16_t usLength)
{
@@ -162,7 +162,7 @@ long cc3000_read(uint8_t *pUserBuffer, uint16_t usLength)
return read(spiconf.cc3000fd,pUserBuffer,usLength);
}
/*****************************************************************************
/****************************************************************************
* Name: cc3000_wait
*
* Description:
@@ -173,7 +173,7 @@ long cc3000_read(uint8_t *pUserBuffer, uint16_t usLength)
*
* Returned Value:
*
*****************************************************************************/
****************************************************************************/
uint8_t *cc3000_wait(void)
{
@@ -184,7 +184,7 @@ uint8_t *cc3000_wait(void)
return spiconf.rx_buffer.pbuffer;
}
/*****************************************************************************
/****************************************************************************
* Name: unsoliced_thread_func
*
* Description:
@@ -196,7 +196,7 @@ uint8_t *cc3000_wait(void)
*
* Returned Value:
*
*****************************************************************************/
****************************************************************************/
static void *unsoliced_thread_func(void *parameter)
{
@@ -234,7 +234,7 @@ static void *unsoliced_thread_func(void *parameter)
return (pthread_addr_t)status;
}
/*****************************************************************************
/****************************************************************************
* Name: cc3000_open
*
* Description:
@@ -246,7 +246,7 @@ static void *unsoliced_thread_func(void *parameter)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void cc3000_open(gcSpiHandleRx pfRxHandler)
{
@@ -286,7 +286,7 @@ void cc3000_open(gcSpiHandleRx pfRxHandler)
DEBUGASSERT(spiconf.cc3000fd >= 0);
}
/*****************************************************************************
/****************************************************************************
* Name: cc3000_close
*
* Description:
@@ -298,7 +298,7 @@ void cc3000_open(gcSpiHandleRx pfRxHandler)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void cc3000_close(void)
{
+32 -32
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* evnt_handler.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -51,9 +51,9 @@
#include "cc3000drv.h"
#include <nuttx/wireless/cc3000/netapp.h>
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
#define FLOW_CONTROL_EVENT_HANDLE_OFFSET (0)
#define FLOW_CONTROL_EVENT_BLOCK_MODE_OFFSET (1)
@@ -103,23 +103,23 @@
#define GET_SCAN_RESULTS_FRAME_TIME_OFFSET (10)
#define GET_SCAN_RESULTS_SSID_MAC_LENGTH (38)
/*****************************************************************************
/****************************************************************************
* Public Data
*****************************************************************************/
****************************************************************************/
unsigned long socket_active_status = SOCKET_STATUS_INIT_VAL;
/*****************************************************************************
/****************************************************************************
* Private Function Prototypes
*****************************************************************************/
****************************************************************************/
static long hci_event_unsol_flowcontrol_handler(char *pEvent);
static void update_socket_active_status(char *resp_params);
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
/*****************************************************************************
****************************************************************************/
/****************************************************************************
* Name: hci_unsol_handle_patch_request
*
* Description:
@@ -131,7 +131,7 @@ static void update_socket_active_status(char *resp_params);
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void hci_unsol_handle_patch_request(char *event_hdr)
{
@@ -208,7 +208,7 @@ void hci_unsol_handle_patch_request(char *event_hdr)
}
}
/*****************************************************************************
/****************************************************************************
* Name: hci_event_handler
*
* Description:
@@ -223,7 +223,7 @@ void hci_unsol_handle_patch_request(char *event_hdr)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
uint8_t *hci_event_handler(void *pRetParams, uint8_t *from, uint8_t *fromlen)
{
@@ -552,7 +552,7 @@ uint8_t *hci_event_handler(void *pRetParams, uint8_t *from, uint8_t *fromlen)
return NULL;
}
/*****************************************************************************
/****************************************************************************
* Name: hci_unsol_event_handler
*
* Description:
@@ -565,7 +565,7 @@ uint8_t *hci_event_handler(void *pRetParams, uint8_t *from, uint8_t *fromlen)
* 1 if event supported and handled
* 0 if event is not supported
*
*****************************************************************************/
****************************************************************************/
long hci_unsol_event_handler(char *event_hdr)
{
@@ -737,7 +737,7 @@ long hci_unsol_event_handler(char *event_hdr)
return 0;
}
/*****************************************************************************
/****************************************************************************
* Name: hci_unsolicited_event_handler
*
* Description:
@@ -750,7 +750,7 @@ long hci_unsol_event_handler(char *event_hdr)
* Returned Value:
* ESUCCESS if successful, EFAIL if an error occurred
*
*****************************************************************************/
****************************************************************************/
long hci_unsolicited_event_handler(void)
{
@@ -782,7 +782,7 @@ long hci_unsolicited_event_handler(void)
return res;
}
/*****************************************************************************
/****************************************************************************
* Name: set_socket_active_status
*
* Description:
@@ -796,7 +796,7 @@ long hci_unsolicited_event_handler(void)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void set_socket_active_status(long Sd, long Status)
{
@@ -807,7 +807,7 @@ void set_socket_active_status(long Sd, long Status)
}
}
/*****************************************************************************
/****************************************************************************
* Name: hci_event_unsol_flowcontrol_handler
*
* Description:
@@ -821,7 +821,7 @@ void set_socket_active_status(long Sd, long Status)
* Returned Value:
* ESUCCESS if successful, EFAIL if an error occurred
*
*****************************************************************************/
****************************************************************************/
long hci_event_unsol_flowcontrol_handler(char *pEvent)
{
@@ -848,7 +848,7 @@ long hci_event_unsol_flowcontrol_handler(char *pEvent)
return(ESUCCESS);
}
/*****************************************************************************
/****************************************************************************
* Name: get_socket_active_status
*
* Description:
@@ -860,7 +860,7 @@ long hci_event_unsol_flowcontrol_handler(char *pEvent)
* Returned Value:
* Current status of the socket.
*
*****************************************************************************/
****************************************************************************/
long get_socket_active_status(long Sd)
{
@@ -873,7 +873,7 @@ long get_socket_active_status(long Sd)
return SOCKET_STATUS_INACTIVE;
}
/*****************************************************************************
/****************************************************************************
* Name: update_socket_active_status
*
* Description:
@@ -885,7 +885,7 @@ long get_socket_active_status(long Sd)
* Returned Value:
* Current status of the socket.
*
*****************************************************************************/
****************************************************************************/
void update_socket_active_status(char *resp_params)
{
@@ -900,7 +900,7 @@ void update_socket_active_status(char *resp_params)
}
}
/*****************************************************************************
/****************************************************************************
* Name: SimpleLinkWaitEvent
*
* Description:
@@ -914,7 +914,7 @@ void update_socket_active_status(char *resp_params)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void SimpleLinkWaitEvent(uint16_t opcode, void *pRetParams)
{
@@ -956,7 +956,7 @@ void SimpleLinkWaitEvent(uint16_t opcode, void *pRetParams)
nllvdbg("Done for opcode 0x%x\n",opcode);
}
/*****************************************************************************
/****************************************************************************
* Name: SimpleLinkWaitData
*
* Description:
@@ -971,7 +971,7 @@ void SimpleLinkWaitEvent(uint16_t opcode, void *pRetParams)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen)
{
+16 -16
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* hci.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -47,16 +47,16 @@
#include <nuttx/wireless/cc3000/evnt_handler.h>
#include <nuttx/wireless/cc3000/wlan.h>
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
#define SL_PATCH_PORTION_SIZE (1000)
/******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
/******************************************************************************
****************************************************************************/
/****************************************************************************
* Name: hci_command_send
*
* Description:
@@ -70,7 +70,7 @@
* Returned Value:
* Zero
*
*****************************************************************************/
****************************************************************************/
uint16_t hci_command_send(uint16_t usOpcode, uint8_t *pucBuff,
uint8_t ucArgsLength)
@@ -92,7 +92,7 @@ uint16_t hci_command_send(uint16_t usOpcode, uint8_t *pucBuff,
return 0;
}
/******************************************************************************
/****************************************************************************
* Name: hci_data_send
*
* Description:
@@ -108,7 +108,7 @@ uint16_t hci_command_send(uint16_t usOpcode, uint8_t *pucBuff,
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
long hci_data_send(uint8_t ucOpcode, uint8_t *ucArgs, uint16_t usArgsLength,
uint16_t usDataLength, const uint8_t *ucTail,
@@ -132,7 +132,7 @@ long hci_data_send(uint8_t ucOpcode, uint8_t *ucArgs, uint16_t usArgsLength,
return ESUCCESS;
}
/******************************************************************************
/****************************************************************************
* Name: hci_data_command_send
*
* Description:
@@ -147,7 +147,7 @@ long hci_data_send(uint8_t ucOpcode, uint8_t *ucArgs, uint16_t usArgsLength,
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void hci_data_command_send(uint16_t usOpcode, uint8_t *pucBuff,
uint8_t ucArgsLength,uint16_t ucDataLength)
@@ -166,7 +166,7 @@ void hci_data_command_send(uint16_t usOpcode, uint8_t *pucBuff,
SIMPLE_LINK_HCI_DATA_CMND_HEADER_SIZE);
}
/******************************************************************************
/****************************************************************************
* Name: hci_patch_send
*
* Description:
@@ -181,7 +181,7 @@ void hci_data_command_send(uint16_t usOpcode, uint8_t *pucBuff,
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void hci_patch_send(uint8_t ucOpcode, uint8_t *pucBuff, char *patch,
uint16_t usDataLength)
+26 -26
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* netapp.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <string.h>
@@ -46,9 +46,9 @@
#include "cc3000.h"
#include "cc3000_socket.h"
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
#define MIN_TIMER_VAL_SECONDS 20
#define MIN_TIMER_SET(t) if ((0 != t) && (t < MIN_TIMER_VAL_SECONDS)) \
@@ -62,11 +62,11 @@
#define NETAPP_SET_DEBUG_LEVEL_PARAMS_LEN (4)
#define NETAPP_PING_SEND_PARAMS_LEN (16)
/******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Name: netapp_config_mac_adrress
*
* Description:
@@ -80,14 +80,14 @@
* Returned Value:
* Return on success 0, otherwise error.
*
*****************************************************************************/
****************************************************************************/
long netapp_config_mac_adrress(uint8_t *mac)
{
return nvmem_set_mac_address(mac);
}
/******************************************************************************
/****************************************************************************
* Name: netapp_dhcp
*
* Description:
@@ -112,7 +112,7 @@ long netapp_config_mac_adrress(uint8_t *mac)
* Returned Value:
* Return on success 0, otherwise error.
*
*****************************************************************************/
****************************************************************************/
long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,
unsigned long *aucDefaultGateway, unsigned long *aucDNSServer)
@@ -148,7 +148,7 @@ long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,
return(scRet);
}
/******************************************************************************
/****************************************************************************
* Name: netapp_timeout_values
*
* Description:
@@ -196,7 +196,7 @@ long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,
* Returned Value:
* Return on success 0, otherwise error.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,
@@ -241,7 +241,7 @@ long netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_ping_send
*
* Description:
@@ -263,7 +263,7 @@ long netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,
* Returned Value:
* Return on success 0, otherwise error.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long netapp_ping_send(unsigned long *ip, unsigned long ulPingAttempts,
@@ -299,7 +299,7 @@ long netapp_ping_send(unsigned long *ip, unsigned long ulPingAttempts,
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_ping_report
*
* Description:
@@ -324,7 +324,7 @@ long netapp_ping_send(unsigned long *ip, unsigned long ulPingAttempts,
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
void netapp_ping_report(void)
@@ -349,7 +349,7 @@ void netapp_ping_report(void)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_ping_stop
*
* Description:
@@ -361,7 +361,7 @@ void netapp_ping_report(void)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long netapp_ping_stop(void)
@@ -388,7 +388,7 @@ long netapp_ping_stop(void)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_ipconfig
*
* Description:
@@ -416,7 +416,7 @@ long netapp_ping_stop(void)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
void netapp_ipconfig(tNetappIpconfigRetArgs * ipconfig)
@@ -443,7 +443,7 @@ void netapp_ipconfig(tNetappIpconfigRetArgs * ipconfig)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_arp_flush
*
* Description:
@@ -455,7 +455,7 @@ void netapp_ipconfig(tNetappIpconfigRetArgs * ipconfig)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long netapp_arp_flush(void)
@@ -483,7 +483,7 @@ long netapp_arp_flush(void)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_set_debug_level
*
* Description:
@@ -507,7 +507,7 @@ long netapp_arp_flush(void)
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long netapp_set_debug_level(unsigned long ulLevel)
+22 -22
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* nvmem.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <stdio.h>
#include <string.h>
@@ -44,18 +44,18 @@
#include <nuttx/wireless/cc3000/evnt_handler.h>
#include "cc3000.h"
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
#define NVMEM_READ_PARAMS_LEN (12)
#define NVMEM_CREATE_PARAMS_LEN (8)
#define NVMEM_WRITE_PARAMS_LEN (16)
/******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
/******************************************************************************
****************************************************************************/
/****************************************************************************
* Name: nvmem_read
*
* Description:
@@ -79,7 +79,7 @@
* Returned Value:
* Number of bytes read, otherwise error.
*
*****************************************************************************/
****************************************************************************/
signed long nvmem_read(unsigned long ulFileId, unsigned long ulLength,
unsigned long ulOffset, uint8_t *buff)
@@ -120,7 +120,7 @@ signed long nvmem_read(unsigned long ulFileId, unsigned long ulLength,
return ucStatus;
}
/******************************************************************************
/****************************************************************************
* Name: nvmem_write
*
* Description:
@@ -141,7 +141,7 @@ signed long nvmem_read(unsigned long ulFileId, unsigned long ulLength,
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
signed long nvmem_write(unsigned long ulFileId, unsigned long ulLength,
unsigned long ulEntryOffset, uint8_t *buff)
@@ -179,7 +179,7 @@ signed long nvmem_write(unsigned long ulFileId, unsigned long ulLength,
return iRes;
}
/******************************************************************************
/****************************************************************************
* Name: nvmem_set_mac_address
*
* Description:
@@ -192,14 +192,14 @@ signed long nvmem_write(unsigned long ulFileId, unsigned long ulLength,
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
uint8_t nvmem_set_mac_address(uint8_t *mac)
{
return nvmem_write(NVMEM_MAC_FILEID, MAC_ADDR_LEN, 0, mac);
}
/******************************************************************************
/****************************************************************************
* Name: nvmem_get_mac_address
*
* Description:
@@ -212,14 +212,14 @@ uint8_t nvmem_set_mac_address(uint8_t *mac)
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
uint8_t nvmem_get_mac_address(uint8_t *mac)
{
return nvmem_read(NVMEM_MAC_FILEID, MAC_ADDR_LEN, 0, mac);
}
/******************************************************************************
/****************************************************************************
* Name: nvmem_write_patch
*
* Description:
@@ -236,7 +236,7 @@ uint8_t nvmem_get_mac_address(uint8_t *mac)
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
uint8_t nvmem_write_patch(unsigned long ulFileId, unsigned long spLength,
const uint8_t *spData)
@@ -270,7 +270,7 @@ uint8_t nvmem_write_patch(unsigned long ulFileId, unsigned long spLength,
return status;
}
/******************************************************************************
/****************************************************************************
* Name: nvmem_read_sp_version
*
* Description:
@@ -284,7 +284,7 @@ uint8_t nvmem_write_patch(unsigned long ulFileId, unsigned long spLength,
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
uint8_t nvmem_read_sp_version(uint8_t *patchVer)
@@ -316,7 +316,7 @@ uint8_t nvmem_read_sp_version(uint8_t *patchVer)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: nvmem_create_entry
*
* Description:
@@ -336,7 +336,7 @@ uint8_t nvmem_read_sp_version(uint8_t *patchVer)
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
signed long nvmem_create_entry(unsigned long ulFileId, unsigned long ulNewLen)
{
+16 -16
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* security.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,19 +30,19 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/wireless/cc3000/security.h>
#ifndef CC3000_UNENCRYPTED_SMART_CONFIG
/*****************************************************************************
/****************************************************************************
* Private Data
*****************************************************************************/
****************************************************************************/
// foreward sbox
@@ -98,9 +98,9 @@ const uint8_t Rcon[11] =
uint8_t aexpandedKey[176];
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
//*****************************************************************************
//
//! expandKey
@@ -443,7 +443,7 @@ void aes_decr(uint8_t *state, uint8_t *expandedKey)
}
/*****************************************************************************
/****************************************************************************
* Name: aes_encrypt
*
* Description:
@@ -458,7 +458,7 @@ void aes_decr(uint8_t *state, uint8_t *expandedKey)
* Returned Value
* None
*
*****************************************************************************/
****************************************************************************/
void aes_encrypt(uint8_t *state, uint8_t *key)
{
@@ -467,7 +467,7 @@ void aes_encrypt(uint8_t *state, uint8_t *key)
aes_encr(state, aexpandedKey);
}
/*****************************************************************************
/****************************************************************************
* Name: aes_decrypt
*
* Description:
@@ -482,7 +482,7 @@ void aes_encrypt(uint8_t *state, uint8_t *key)
* Returned Value
* None
*
*****************************************************************************/
****************************************************************************/
void aes_decrypt(uint8_t *state, uint8_t *key)
{
@@ -490,7 +490,7 @@ void aes_decrypt(uint8_t *state, uint8_t *key)
aes_decr(state, aexpandedKey);
}
/*****************************************************************************
/****************************************************************************
* Name: aes_read_key
*
* Description:
@@ -503,7 +503,7 @@ void aes_decrypt(uint8_t *state, uint8_t *key)
* Returned Value
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
signed long aes_read_key(uint8_t *key)
{
@@ -514,7 +514,7 @@ signed long aes_read_key(uint8_t *key)
return returnValue;
}
/*****************************************************************************
/****************************************************************************
* Name: aes_write_key
*
* Description:
@@ -527,7 +527,7 @@ signed long aes_read_key(uint8_t *key)
* Returned Value
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
signed long aes_write_key(uint8_t *key)
{
+36 -36
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* socket.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <sys/types.h>
#include <sys/select.h>
@@ -54,9 +54,9 @@
#include "cc3000drv.h"
#include "cc3000.h"
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
@@ -99,7 +99,7 @@ static const int bsd2ti_types[] =
* Public Functions
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: socket
*
* Description:
@@ -120,7 +120,7 @@ static const int bsd2ti_types[] =
* On success, socket handle that is used for consequent socket
* operations. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
int cc3000_socket(int domain, int type, int protocol)
{
@@ -175,7 +175,7 @@ int cc3000_socket(int domain, int type, int protocol)
return sd;
}
/*****************************************************************************
/****************************************************************************
* Name: closesocket
*
* Description:
@@ -187,7 +187,7 @@ int cc3000_socket(int domain, int type, int protocol)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
int cc3000_closesocket(int sockfd)
{
@@ -205,7 +205,7 @@ int cc3000_closesocket(int sockfd)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: accept, cc3000_do_accept
*
* Description:
@@ -248,7 +248,7 @@ int cc3000_closesocket(int sockfd)
* - On connection pending, SOC_IN_PROGRESS (-2)
* - On failure, SOC_ERROR (-1)
*
*****************************************************************************/
****************************************************************************/
int cc3000_do_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
{
@@ -290,7 +290,7 @@ int cc3000_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: bind
*
* Description:
@@ -311,7 +311,7 @@ int cc3000_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
int cc3000_bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
{
@@ -323,7 +323,7 @@ int cc3000_bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: listen
*
* Description:
@@ -345,7 +345,7 @@ int cc3000_bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
int cc3000_listen(int sockfd, int backlog)
{
@@ -357,7 +357,7 @@ int cc3000_listen(int sockfd, int backlog)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: connect
*
* Description:
@@ -385,7 +385,7 @@ int cc3000_listen(int sockfd, int backlog)
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
int cc3000_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
{
@@ -397,7 +397,7 @@ int cc3000_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrle
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: select
*
* Description:
@@ -434,7 +434,7 @@ int cc3000_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrle
* will return without delay.
* *exceptfds - return the sockets which closed recently.
*
*****************************************************************************/
****************************************************************************/
int cc3000_select(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds,
struct timeval *timeout)
@@ -450,7 +450,7 @@ int cc3000_select(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds,
}
#ifndef CC3000_TINY_DRIVER
/*****************************************************************************
/****************************************************************************
* Name: setsockopt
*
* Description:
@@ -496,7 +496,7 @@ int cc3000_select(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds,
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
int cc3000_setsockopt(int sockfd, int level, int option,
FAR const void *value, socklen_t value_len)
@@ -510,7 +510,7 @@ int cc3000_setsockopt(int sockfd, int level, int option,
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: getsockopt
*
* Description:
@@ -556,7 +556,7 @@ int cc3000_setsockopt(int sockfd, int level, int option,
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
int cc3000_getsockopt(int sockfd, int level, int option, FAR void *value,
FAR socklen_t *value_len)
@@ -569,7 +569,7 @@ int cc3000_getsockopt(int sockfd, int level, int option, FAR void *value,
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: recv
*
* Description:
@@ -589,7 +589,7 @@ int cc3000_getsockopt(int sockfd, int level, int option, FAR void *value,
* Return the number of bytes received, or -1 if an error
* occurred
*
*****************************************************************************/
****************************************************************************/
ssize_t cc3000_recv(int sockfd, FAR void *buf, size_t len, int flags)
{
@@ -619,7 +619,7 @@ ssize_t cc3000_recv(int sockfd, FAR void *buf, size_t len, int flags)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: recvfrom
*
* Description:
@@ -646,7 +646,7 @@ ssize_t cc3000_recv(int sockfd, FAR void *buf, size_t len, int flags)
* Return the number of bytes received, or -1 if an error
* occurred
*
*****************************************************************************/
****************************************************************************/
ssize_t cc3000_recvfrom(int sockfd, FAR void *buf, size_t len, int flags,
FAR struct sockaddr *from, FAR socklen_t *fromlen)
@@ -672,7 +672,7 @@ ssize_t cc3000_recvfrom(int sockfd, FAR void *buf, size_t len, int flags,
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: send
*
* Description:
@@ -692,7 +692,7 @@ ssize_t cc3000_recvfrom(int sockfd, FAR void *buf, size_t len, int flags,
* Return the number of bytes transmitted, or -1 if an
* error occurred
*
*****************************************************************************/
****************************************************************************/
ssize_t cc3000_send(int sockfd, FAR const void *buf, size_t len, int flags)
{
@@ -704,7 +704,7 @@ ssize_t cc3000_send(int sockfd, FAR const void *buf, size_t len, int flags)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: sendto
*
* Description:
@@ -728,7 +728,7 @@ ssize_t cc3000_send(int sockfd, FAR const void *buf, size_t len, int flags)
* Return the number of bytes transmitted, or -1 if an
* error occurred
*
*****************************************************************************/
****************************************************************************/
ssize_t cc3000_sendto(int sockfd, FAR const void *buf, size_t len, int flags,
FAR const struct sockaddr *to, socklen_t tolen)
@@ -741,7 +741,7 @@ ssize_t cc3000_sendto(int sockfd, FAR const void *buf, size_t len, int flags,
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: gethostbyname
*
* Description:
@@ -762,7 +762,7 @@ ssize_t cc3000_sendto(int sockfd, FAR const void *buf, size_t len, int flags,
* Returned Value:
* On success, positive is returned. On error, negative is returned
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
// TODO: Standard is struct hostent *gethostbyname(const char *name);
@@ -777,7 +777,7 @@ int cc3000_gethostbyname(char * hostname, uint16_t usNameLen, unsigned long* out
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: mdnsAdvertiser
*
* Description:
@@ -793,7 +793,7 @@ int cc3000_gethostbyname(char * hostname, uint16_t usNameLen, unsigned long* out
* On success, zero is returned, return SOC_ERROR if socket was not
* opened successfully, or if an error occurred.
*
*****************************************************************************/
****************************************************************************/
int cc3000_mdnsadvertiser(uint16_t mdnsEnabled, char *deviceServiceName,
uint16_t deviceServiceNameLength)
+43 -43
View File
@@ -33,11 +33,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <sys/time.h>
#include <stdio.h>
@@ -51,9 +51,9 @@
#include <nuttx/wireless/cc3000/evnt_handler.h>
#include <nuttx/wireless/cc3000/netapp.h>
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
/* Enable this flag if and only if you must comply with BSD socket close()
* function
@@ -101,10 +101,10 @@
#define MDNS_DEVICE_SERVICE_MAX_LENGTH (32)
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
/*****************************************************************************
****************************************************************************/
/****************************************************************************
* Name: HostFlowControlConsumeBuff
*
* Input Parameters:
@@ -121,7 +121,7 @@
* becomes available, else return immediately with correct status
* regarding the buffers available.
*
*****************************************************************************/
****************************************************************************/
int HostFlowControlConsumeBuff(int sd)
{
@@ -197,7 +197,7 @@ int HostFlowControlConsumeBuff(int sd)
#endif
}
/*****************************************************************************
/****************************************************************************
* Name: socket
*
* Decription:
@@ -218,7 +218,7 @@ int HostFlowControlConsumeBuff(int sd)
* On success, socket handle that is used for consequent socket
* operations. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
int cc3000_socket_impl(long domain, long type, long protocol)
{
@@ -250,7 +250,7 @@ int cc3000_socket_impl(long domain, long type, long protocol)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: closesocket
*
* Decription:
@@ -262,7 +262,7 @@ int cc3000_socket_impl(long domain, long type, long protocol)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
long cc3000_closesocket_impl(long sd)
{
@@ -296,7 +296,7 @@ long cc3000_closesocket_impl(long sd)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: accept
*
* Decription:
@@ -339,7 +339,7 @@ long cc3000_closesocket_impl(long sd)
* - On connection pending, SOC_IN_PROGRESS (-2)
* - On failure, SOC_ERROR (-1)
*
*****************************************************************************/
****************************************************************************/
long cc3000_accept_impl(long sd, struct sockaddr *addr, socklen_t *addrlen)
{
@@ -385,7 +385,7 @@ long cc3000_accept_impl(long sd, struct sockaddr *addr, socklen_t *addrlen)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: bind
*
* Decription:
@@ -406,7 +406,7 @@ long cc3000_accept_impl(long sd, struct sockaddr *addr, socklen_t *addrlen)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
long cc3000_bind_impl(long sd, const struct sockaddr *addr, socklen_t addrlen)
{
@@ -439,7 +439,7 @@ long cc3000_bind_impl(long sd, const struct sockaddr *addr, socklen_t addrlen)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: listen
*
* Decription:
@@ -461,7 +461,7 @@ long cc3000_bind_impl(long sd, const struct sockaddr *addr, socklen_t addrlen)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
long cc3000_listen_impl(long sd, long backlog)
{
@@ -490,7 +490,7 @@ long cc3000_listen_impl(long sd, long backlog)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: gethostbyname
*
* Decription:
@@ -511,7 +511,7 @@ long cc3000_listen_impl(long sd, long backlog)
* Returned Value:
* On success, positive is returned. On error, negative is returned
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
int cc3000_gethostbyname_impl(char * hostname, uint16_t usNameLen, unsigned long* out_ip_addr)
@@ -552,7 +552,7 @@ int cc3000_gethostbyname_impl(char * hostname, uint16_t usNameLen, unsigned long
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: connect
*
* Decription:
@@ -580,7 +580,7 @@ int cc3000_gethostbyname_impl(char * hostname, uint16_t usNameLen, unsigned long
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
long cc3000_connect_impl(long sd, const struct sockaddr *addr, socklen_t addrlen)
{
@@ -612,7 +612,7 @@ long cc3000_connect_impl(long sd, const struct sockaddr *addr, socklen_t addrlen
return (long)ret;
}
/*****************************************************************************
/****************************************************************************
* Name: select
*
* Decription:
@@ -649,7 +649,7 @@ long cc3000_connect_impl(long sd, const struct sockaddr *addr, socklen_t addrlen
* will return without delay.
* *exceptsds - return the sockets which closed recently.
*
*****************************************************************************/
****************************************************************************/
int cc3000_select_impl(long nfds, TICC3000fd_set *readsds, TICC3000fd_set *writesds,
TICC3000fd_set *exceptsds, struct timeval *timeout)
@@ -732,7 +732,7 @@ int cc3000_select_impl(long nfds, TICC3000fd_set *readsds, TICC3000fd_set *write
}
}
/*****************************************************************************
/****************************************************************************
* Name: setsockopt
*
* Decription:
@@ -778,7 +778,7 @@ int cc3000_select_impl(long nfds, TICC3000fd_set *readsds, TICC3000fd_set *write
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
int cc3000_setsockopt_impl(long sd, long level, long optname, const void *optval, socklen_t optlen)
@@ -819,7 +819,7 @@ int cc3000_setsockopt_impl(long sd, long level, long optname, const void *optval
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: getsockopt
*
* Decription:
@@ -865,7 +865,7 @@ int cc3000_setsockopt_impl(long sd, long level, long optname, const void *optval
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
int cc3000_getsockopt_impl(long sd, long level, long optname, void *optval, socklen_t *optlen)
{
@@ -903,7 +903,7 @@ int cc3000_getsockopt_impl(long sd, long level, long optname, void *optval, sock
}
}
/*****************************************************************************
/****************************************************************************
* Name: simple_link_recv
*
* Input Parameters:
@@ -925,7 +925,7 @@ int cc3000_getsockopt_impl(long sd, long level, long optname, void *optval, sock
* excess bytes may be discarded depending on the type of
* socket the message is received from
*
*****************************************************************************/
****************************************************************************/
int simple_link_recv(long sd, void *buf, long len, long flags, struct sockaddr *from,
socklen_t *fromlen, long opcode)
@@ -965,7 +965,7 @@ int simple_link_recv(long sd, void *buf, long len, long flags, struct sockaddr *
return tSocketReadEvent.iNumberOfBytes;
}
/*****************************************************************************
/****************************************************************************
* Name: recv
*
* Decription:
@@ -985,14 +985,14 @@ int simple_link_recv(long sd, void *buf, long len, long flags, struct sockaddr *
* Return the number of bytes received, or -1 if an error
* occurred
*
*****************************************************************************/
****************************************************************************/
int cc3000_recv_impl(long sd, void *buf, long len, long flags)
{
return(simple_link_recv(sd, buf, len, flags, NULL, NULL, HCI_CMND_RECV));
}
/*****************************************************************************
/****************************************************************************
* Name: recvfrom
*
* Decription:
@@ -1019,7 +1019,7 @@ int cc3000_recv_impl(long sd, void *buf, long len, long flags)
* Return the number of bytes received, or -1 if an error
* occurred
*
*****************************************************************************/
****************************************************************************/
int cc3000_recvfrom_impl(long sd, void *buf, long len, long flags, struct sockaddr *from,
socklen_t *fromlen)
@@ -1028,7 +1028,7 @@ int cc3000_recvfrom_impl(long sd, void *buf, long len, long flags, struct sockad
HCI_CMND_RECVFROM));
}
/*****************************************************************************
/****************************************************************************
* Name: simple_link_send
*
* Input Parameters:
@@ -1049,7 +1049,7 @@ int cc3000_recvfrom_impl(long sd, void *buf, long len, long flags, struct sockad
* This function is used to transmit a message to another
* socket
*
*****************************************************************************/
****************************************************************************/
int simple_link_send(long sd, const void *buf, long len, long flags,
const struct sockaddr *to, long tolen, long opcode)
@@ -1144,7 +1144,7 @@ int simple_link_send(long sd, const void *buf, long len, long flags,
return len;
}
/*****************************************************************************
/****************************************************************************
* Name: send
*
* Decription:
@@ -1164,14 +1164,14 @@ int simple_link_send(long sd, const void *buf, long len, long flags,
* Return the number of bytes transmitted, or -1 if an
* error occurred
*
*****************************************************************************/
****************************************************************************/
int cc3000_send_impl(long sd, const void *buf, long len, long flags)
{
return(simple_link_send(sd, buf, len, flags, NULL, 0, HCI_CMND_SEND));
}
/*****************************************************************************
/****************************************************************************
* Name: sendto
*
* Decription:
@@ -1195,7 +1195,7 @@ int cc3000_send_impl(long sd, const void *buf, long len, long flags)
* Return the number of bytes transmitted, or -1 if an
* error occurred
*
*****************************************************************************/
****************************************************************************/
int cc3000_sendto_impl(long sd, const void *buf, long len, long flags, const struct sockaddr *to,
socklen_t tolen)
@@ -1203,7 +1203,7 @@ int cc3000_sendto_impl(long sd, const void *buf, long len, long flags, const str
return(simple_link_send(sd, buf, len, flags, to, tolen, HCI_CMND_SENDTO));
}
/*****************************************************************************
/****************************************************************************
* Name: mdnsAdvertiser
*
* Decription:
@@ -1219,7 +1219,7 @@ int cc3000_sendto_impl(long sd, const void *buf, long len, long flags, const str
* On success, zero is returned, return SOC_ERROR if socket was not
* opened successfully, or if an error occurred.
*
*****************************************************************************/
****************************************************************************/
int cc3000_mdnsadvertiser_impl(uint16_t mdnsEnabled, char * deviceServiceName,
uint16_t deviceServiceNameLength)
+48 -48
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* wlan.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
@@ -53,9 +53,9 @@
#include "cc3000.h"
#include "cc3000drv.h"
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
#define SMART_CONFIG_PROFILE_SIZE 67 /* 67 = 32 (max ssid) + 32 (max key) +
* 1 (SSID length) + 1 (security type) +
@@ -102,9 +102,9 @@
* Private Variables
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Public Data
*****************************************************************************/
****************************************************************************/
volatile sSimplLinkInformation tSLInformation;
#ifndef CC3000_UNENCRYPTED_SMART_CONFIG
@@ -112,10 +112,10 @@ uint8_t akey[AES128_KEY_SIZE];
uint8_t profileArray[SMART_CONFIG_PROFILE_SIZE];
#endif /* CC3000_UNENCRYPTED_SMART_CONFIG */
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
/*****************************************************************************
****************************************************************************/
/****************************************************************************
* Name: SimpleLink_Init_Start
*
* Input Parameters:
@@ -132,7 +132,7 @@ uint8_t profileArray[SMART_CONFIG_PROFILE_SIZE];
* Description:
* Send HCI_CMND_SIMPLE_LINK_START to CC3000
*
*****************************************************************************/
****************************************************************************/
static void SimpleLink_Init_Start(uint16_t usPatchesAvailableAtHost)
{
@@ -157,7 +157,7 @@ static void SimpleLink_Init_Start(uint16_t usPatchesAvailableAtHost)
SimpleLinkWaitEvent(HCI_CMND_SIMPLE_LINK_START, 0);
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_init
*
* Input Parameters:
@@ -193,7 +193,7 @@ static void SimpleLink_Init_Start(uint16_t usPatchesAvailableAtHost)
*
* WARNING: This function must be called before ANY other wlan driver function
*
*****************************************************************************/
****************************************************************************/
void wlan_init(size_t max_tx_len,
tWlanCB sWlanCB,
@@ -235,7 +235,7 @@ void wlan_init(size_t max_tx_len,
}
}
/*****************************************************************************
/****************************************************************************
* Name: SpiReceiveHandler
*
* Input Parameters:
@@ -248,7 +248,7 @@ void wlan_init(size_t max_tx_len,
* The function triggers Received event/data processing. It is
* called from the SPI library to receive the data
*
*****************************************************************************/
****************************************************************************/
void SpiReceiveHandler(void *pvBuffer)
{
@@ -266,7 +266,7 @@ void SpiReceiveHandler(void *pvBuffer)
hci_unsolicited_event_handler();
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_start
*
* Input Parameters:
@@ -291,7 +291,7 @@ void SpiReceiveHandler(void *pvBuffer)
* WARNING: This function must be called after wlan_init and before any
* other wlan API
*
*****************************************************************************/
****************************************************************************/
void wlan_start(uint16_t usPatchesAvailableAtHost)
{
@@ -321,7 +321,7 @@ void wlan_start(uint16_t usPatchesAvailableAtHost)
cc3000_lib_unlock();
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_get_buffer
*
* Input Parameters:
@@ -330,14 +330,14 @@ void wlan_start(uint16_t usPatchesAvailableAtHost)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void wlan_get_buffer(wlan_buffer_desc *pdes)
{
*pdes = tSLInformation.usrBuffer;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_stop
*
* Input Parameters:
@@ -349,7 +349,7 @@ void wlan_get_buffer(wlan_buffer_desc *pdes)
* Description:
* Stop WLAN device by putting it into reset state.
*
*****************************************************************************/
****************************************************************************/
void wlan_stop(void)
{
@@ -358,7 +358,7 @@ void wlan_stop(void)
cc3000_lib_unlock();
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_connect
*
* Input Parameters:
@@ -388,7 +388,7 @@ void wlan_stop(void)
* type WEP, please confirm that the key is set as ASCII and not
* as HEX.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long wlan_connect(unsigned long ulSecType, FAR const char *ssid,
@@ -489,7 +489,7 @@ long wlan_connect(FAR const char *ssid, long ssid_len)
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: wlan_disconnect
*
* Input Parameters:
@@ -501,7 +501,7 @@ long wlan_connect(FAR const char *ssid, long ssid_len)
* Description:
* Disconnect connection from AP.
*
*****************************************************************************/
****************************************************************************/
long wlan_disconnect(void)
{
@@ -525,7 +525,7 @@ long wlan_disconnect(void)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_ioctl_set_connection_policy
*
* Input Parameters:
@@ -555,7 +555,7 @@ long wlan_disconnect(void)
* enabled, the device will try to connect to any AP.
* * Note that the policy settings are stored in the CC3000 NVMEM.
*
*****************************************************************************/
****************************************************************************/
long wlan_ioctl_set_connection_policy(unsigned long should_connect_to_open_ap,
unsigned long ulShouldUseFastConnect,
@@ -590,7 +590,7 @@ long wlan_ioctl_set_connection_policy(unsigned long should_connect_to_open_ap,
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_add_profile
*
* Input Parameters:
@@ -616,7 +616,7 @@ long wlan_ioctl_set_connection_policy(unsigned long should_connect_to_open_ap,
* profile based on security policy, signal strength, etc
* parameters. All the profiles are stored in CC3000 NVMEM.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long wlan_add_profile(unsigned long ulSecType, uint8_t *ucSsid,
@@ -756,7 +756,7 @@ long wlan_add_profile(unsigned long ulSecType, uint8_t * ucSsid, uint8_t ulSsidL
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: wlan_ioctl_del_profile
*
* Input Parameters:
@@ -770,7 +770,7 @@ long wlan_add_profile(unsigned long ulSecType, uint8_t * ucSsid, uint8_t ulSsidL
*
* @Note In order to delete all stored profile, set index to 255.
*
*****************************************************************************/
****************************************************************************/
long wlan_ioctl_del_profile(unsigned long ulIndex)
{
@@ -802,7 +802,7 @@ long wlan_ioctl_del_profile(unsigned long ulIndex)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_ioctl_get_scan_results
*
* Input Parameters:
@@ -833,7 +833,7 @@ long wlan_ioctl_del_profile(unsigned long ulIndex)
*
* NOTE: scan_timeout, is not supported on this version.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long wlan_ioctl_get_scan_results(unsigned long ulScanTimeout, uint8_t *ucResults)
@@ -865,7 +865,7 @@ long wlan_ioctl_get_scan_results(unsigned long ulScanTimeout, uint8_t *ucResults
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: wlan_ioctl_set_scan_params
*
* Input Parameters:
@@ -900,7 +900,7 @@ long wlan_ioctl_get_scan_results(unsigned long ulScanTimeout, uint8_t *ucResults
*
* @Note uiDefaultTxPower, is not supported on this version.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long wlan_ioctl_set_scan_params(unsigned long uiEnable,
@@ -950,7 +950,7 @@ long wlan_ioctl_set_scan_params(unsigned long uiEnable,
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: wlan_set_event_mask
*
* Input Parameters:
@@ -972,7 +972,7 @@ long wlan_ioctl_set_scan_params(unsigned long uiEnable,
* Mask event according to bit mask. In case that event is
* masked (1), the device will not send the masked event to host.
*
*****************************************************************************/
****************************************************************************/
long wlan_set_event_mask(unsigned long ulMask)
{
@@ -1025,7 +1025,7 @@ long wlan_set_event_mask(unsigned long ulMask)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_ioctl_statusget
*
* Input Parameters:
@@ -1038,7 +1038,7 @@ long wlan_set_event_mask(unsigned long ulMask)
* Description:
* get wlan status: disconnected, scanning, connecting or connected
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long wlan_ioctl_statusget(void)
@@ -1064,7 +1064,7 @@ long wlan_ioctl_statusget(void)
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: wlan_smart_config_start
*
* Input Parameters:
@@ -1083,7 +1083,7 @@ long wlan_ioctl_statusget(void)
* @Note An asynchronous event - Smart Config Done will be generated as soon
* as the process finishes successfully.
*
*****************************************************************************/
****************************************************************************/
long wlan_smart_config_start(unsigned long algoEncryptedFlag)
{
@@ -1112,7 +1112,7 @@ long wlan_smart_config_start(unsigned long algoEncryptedFlag)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_smart_config_stop
*
* Input Parameters:
@@ -1124,7 +1124,7 @@ long wlan_smart_config_start(unsigned long algoEncryptedFlag)
* Description:
* Stop the acquire profile procedure
*
*****************************************************************************/
****************************************************************************/
long wlan_smart_config_stop(void)
{
@@ -1146,7 +1146,7 @@ long wlan_smart_config_stop(void)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_smart_config_set_prefix
*
* Input Parameters:
@@ -1161,7 +1161,7 @@ long wlan_smart_config_stop(void)
*
* @Note The prefix is stored in CC3000 NVMEM
*
*****************************************************************************/
****************************************************************************/
long wlan_smart_config_set_prefix(char* cNewPrefix)
{
@@ -1203,7 +1203,7 @@ long wlan_smart_config_set_prefix(char* cNewPrefix)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_smart_config_process
*
* Input Parameters:
@@ -1218,7 +1218,7 @@ long wlan_smart_config_set_prefix(char* cNewPrefix)
* The encrypted data is decrypted and stored as a profile.
* behavior is as defined by connection policy.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_UNENCRYPTED_SMART_CONFIG
long wlan_smart_config_process()