Port of TI's CC3100 Websock camera demo. Using FreeRTOS, mbedTLS, also parts of Arducam for cams ov5642 and 0v2640. Can also use MT9D111. Work in progress. Be warned some parts maybe a bit flacky. This is for Seeed Arch max only, for an M3, see the demo for CM3 using the 0v5642 aducam mini.

Dependencies:   mbed

Committer:
dflet
Date:
Tue Sep 15 16:45:04 2015 +0000
Revision:
22:f9b5e0b80bf2
Parent:
0:50cedd586816
Removed some debug.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dflet 0:50cedd586816 1 /*
dflet 0:50cedd586816 2 * protocol.h - CC31xx/CC32xx Host Driver Implementation
dflet 0:50cedd586816 3 *
dflet 0:50cedd586816 4 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
dflet 0:50cedd586816 5 *
dflet 0:50cedd586816 6 *
dflet 0:50cedd586816 7 * Redistribution and use in source and binary forms, with or without
dflet 0:50cedd586816 8 * modification, are permitted provided that the following conditions
dflet 0:50cedd586816 9 * are met:
dflet 0:50cedd586816 10 *
dflet 0:50cedd586816 11 * Redistributions of source code must retain the above copyright
dflet 0:50cedd586816 12 * notice, this list of conditions and the following disclaimer.
dflet 0:50cedd586816 13 *
dflet 0:50cedd586816 14 * Redistributions in binary form must reproduce the above copyright
dflet 0:50cedd586816 15 * notice, this list of conditions and the following disclaimer in the
dflet 0:50cedd586816 16 * documentation and/or other materials provided with the
dflet 0:50cedd586816 17 * distribution.
dflet 0:50cedd586816 18 *
dflet 0:50cedd586816 19 * Neither the name of Texas Instruments Incorporated nor the names of
dflet 0:50cedd586816 20 * its contributors may be used to endorse or promote products derived
dflet 0:50cedd586816 21 * from this software without specific prior written permission.
dflet 0:50cedd586816 22 *
dflet 0:50cedd586816 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dflet 0:50cedd586816 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dflet 0:50cedd586816 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dflet 0:50cedd586816 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dflet 0:50cedd586816 27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dflet 0:50cedd586816 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dflet 0:50cedd586816 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
dflet 0:50cedd586816 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
dflet 0:50cedd586816 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
dflet 0:50cedd586816 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
dflet 0:50cedd586816 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dflet 0:50cedd586816 34 *
dflet 0:50cedd586816 35 */
dflet 0:50cedd586816 36
dflet 0:50cedd586816 37 /*******************************************************************************\
dflet 0:50cedd586816 38 *
dflet 0:50cedd586816 39 * FILE NAME: protocol.h
dflet 0:50cedd586816 40 *
dflet 0:50cedd586816 41 * DESCRIPTION: Constant and data structure definitions and function
dflet 0:50cedd586816 42 * prototypes for the SL protocol module, which implements
dflet 0:50cedd586816 43 * processing of SimpleLink Commands.
dflet 0:50cedd586816 44 *
dflet 0:50cedd586816 45 * AUTHOR:
dflet 0:50cedd586816 46 *
dflet 0:50cedd586816 47 \*******************************************************************************/
dflet 0:50cedd586816 48
dflet 0:50cedd586816 49 #ifndef SL_PROTOCOL_TYPES_H_
dflet 0:50cedd586816 50 #define SL_PROTOCOL_TYPES_H_
dflet 0:50cedd586816 51
dflet 0:50cedd586816 52 namespace mbed_cc3100 {
dflet 0:50cedd586816 53
dflet 0:50cedd586816 54 /****************************************************************************
dflet 0:50cedd586816 55 **
dflet 0:50cedd586816 56 ** User I/F pools definitions
dflet 0:50cedd586816 57 **
dflet 0:50cedd586816 58 ****************************************************************************/
dflet 0:50cedd586816 59
dflet 0:50cedd586816 60 /****************************************************************************
dflet 0:50cedd586816 61 **
dflet 0:50cedd586816 62 ** Definitions for SimpleLink Commands
dflet 0:50cedd586816 63 **
dflet 0:50cedd586816 64 ****************************************************************************/
dflet 0:50cedd586816 65
dflet 0:50cedd586816 66
dflet 0:50cedd586816 67 /* pattern for LE 8/16/32 or BE*/
dflet 0:50cedd586816 68 #define H2N_SYNC_PATTERN {0xBBDDEEFF,0x4321,0x34,0x12}
dflet 0:50cedd586816 69 #define H2N_CNYS_PATTERN {0xBBDDEEFF,0x8765,0x78,0x56}
dflet 0:50cedd586816 70
dflet 0:50cedd586816 71 const uint32_t H2N_DUMMY_PATTERN = (uint32_t)0xFFFFFFFF;
dflet 0:50cedd586816 72 const uint32_t N2H_SYNC_PATTERN = (uint32_t)0xABCDDCBA;
dflet 0:50cedd586816 73 const uint32_t SYNC_PATTERN_LEN = (uint32_t)sizeof(uint32_t);
dflet 0:50cedd586816 74 const uint32_t UART_SET_MODE_MAGIC_CODE = (uint32_t)0xAA55AA55;
dflet 0:50cedd586816 75 #define SPI_16BITS_BUG(pattern) (uint32_t)((uint32_t)pattern & (uint32_t)0xFFFF7FFF)
dflet 0:50cedd586816 76 #define SPI_8BITS_BUG(pattern) (uint32_t)((uint32_t)pattern & (uint32_t)0xFFFFFF7F)
dflet 0:50cedd586816 77
dflet 0:50cedd586816 78
dflet 0:50cedd586816 79
dflet 0:50cedd586816 80 typedef struct {
dflet 0:50cedd586816 81 uint16_t Opcode;
dflet 0:50cedd586816 82 uint16_t Len;
dflet 0:50cedd586816 83 } _SlGenericHeader_t;
dflet 0:50cedd586816 84
dflet 0:50cedd586816 85
dflet 0:50cedd586816 86 typedef struct {
dflet 0:50cedd586816 87 uint32_t Long;
dflet 0:50cedd586816 88 uint16_t Short;
dflet 0:50cedd586816 89 uint8_t Byte1;
dflet 0:50cedd586816 90 uint8_t Byte2;
dflet 0:50cedd586816 91 } _SlSyncPattern_t;
dflet 0:50cedd586816 92
dflet 0:50cedd586816 93 typedef _SlGenericHeader_t _SlCommandHeader_t;
dflet 0:50cedd586816 94
dflet 0:50cedd586816 95 typedef struct {
dflet 0:50cedd586816 96 _SlGenericHeader_t GenHeader;
dflet 0:50cedd586816 97 uint8_t TxPoolCnt;
dflet 0:50cedd586816 98 uint8_t DevStatus;
dflet 0:50cedd586816 99 uint8_t SocketTXFailure;
dflet 0:50cedd586816 100 uint8_t SocketNonBlocking;
dflet 0:50cedd586816 101 } _SlResponseHeader_t;
dflet 0:50cedd586816 102
dflet 0:50cedd586816 103 #define _SL_RESP_SPEC_HDR_SIZE (sizeof(_SlResponseHeader_t) - sizeof(_SlGenericHeader_t))
dflet 0:50cedd586816 104 #define _SL_RESP_HDR_SIZE sizeof(_SlResponseHeader_t)
dflet 0:50cedd586816 105 #define _SL_CMD_HDR_SIZE sizeof(_SlCommandHeader_t)
dflet 0:50cedd586816 106
dflet 0:50cedd586816 107 #define _SL_RESP_ARGS_START(_pMsg) (((_SlResponseHeader_t *)(_pMsg)) + 1)
dflet 0:50cedd586816 108
dflet 0:50cedd586816 109 /* Used only in NWP! */
dflet 0:50cedd586816 110 typedef struct {
dflet 0:50cedd586816 111 _SlCommandHeader_t sl_hdr;
dflet 0:50cedd586816 112 uint8_t func_args_start;
dflet 0:50cedd586816 113 } T_SCMD;
dflet 0:50cedd586816 114
dflet 0:50cedd586816 115
dflet 0:50cedd586816 116 const uint8_t WLAN_CONN_STATUS_BIT = 0x01;
dflet 0:50cedd586816 117 const uint8_t EVENTS_Q_STATUS_BIT = 0x02;
dflet 0:50cedd586816 118 const uint8_t PENDING_RCV_CMD_BIT = 0x04;
dflet 0:50cedd586816 119 const uint8_t FW_BUSY_PACKETS_BIT = 0x08;
dflet 0:50cedd586816 120
dflet 0:50cedd586816 121 const uint32_t INIT_STA_OK = 0x11111111;
dflet 0:50cedd586816 122 const uint32_t INIT_STA_ERR = 0x22222222;
dflet 0:50cedd586816 123 const uint32_t INIT_AP_OK = 0x33333333;
dflet 0:50cedd586816 124 const uint32_t INIT_AP_ERR = 0x44444444;
dflet 0:50cedd586816 125 const uint32_t INIT_P2P_OK = 0x55555555;
dflet 0:50cedd586816 126 const uint32_t INIT_P2P_ERR = 0x66666666;
dflet 0:50cedd586816 127
dflet 0:50cedd586816 128 /****************************************************************************
dflet 0:50cedd586816 129 ** OPCODES
dflet 0:50cedd586816 130 ****************************************************************************/
dflet 0:50cedd586816 131 const uint16_t SL_IPV4_IPV6_OFFSET = ( 9 );
dflet 0:50cedd586816 132 const uint16_t SL_OPCODE_IPV4 = ( 0x0 << SL_IPV4_IPV6_OFFSET );
dflet 0:50cedd586816 133 const uint16_t SL_OPCODE_IPV6 = ( 0x1 << SL_IPV4_IPV6_OFFSET );
dflet 0:50cedd586816 134
dflet 0:50cedd586816 135 const uint16_t SL_SYNC_ASYNC_OFFSET = ( 10 );
dflet 0:50cedd586816 136 const uint16_t SL_OPCODE_SYNC = (0x1 << SL_SYNC_ASYNC_OFFSET );
dflet 0:50cedd586816 137 const uint16_t SL_OPCODE_SILO_OFFSET = ( 11 );
dflet 0:50cedd586816 138 const uint16_t SL_OPCODE_SILO_MASK = ( 0xF << SL_OPCODE_SILO_OFFSET );
dflet 0:50cedd586816 139 const uint16_t SL_OPCODE_SILO_DEVICE = ( 0x0 << SL_OPCODE_SILO_OFFSET );
dflet 0:50cedd586816 140 const uint16_t SL_OPCODE_SILO_WLAN = ( 0x1 << SL_OPCODE_SILO_OFFSET );
dflet 0:50cedd586816 141 const uint16_t SL_OPCODE_SILO_SOCKET = ( 0x2 << SL_OPCODE_SILO_OFFSET );
dflet 0:50cedd586816 142 const uint16_t SL_OPCODE_SILO_NETAPP = ( 0x3 << SL_OPCODE_SILO_OFFSET );
dflet 0:50cedd586816 143 const uint16_t SL_OPCODE_SILO_NVMEM = ( 0x4 << SL_OPCODE_SILO_OFFSET );
dflet 0:50cedd586816 144 const uint16_t SL_OPCODE_SILO_NETCFG = ( 0x5 << SL_OPCODE_SILO_OFFSET );
dflet 0:50cedd586816 145
dflet 0:50cedd586816 146 const uint16_t SL_FAMILY_SHIFT = (0x4);
dflet 0:50cedd586816 147 const uint16_t SL_FLAGS_MASK = (0xF);
dflet 0:50cedd586816 148
dflet 0:50cedd586816 149 const uint16_t SL_OPCODE_DEVICE_INITCOMPLETE = 0x0008;
dflet 0:50cedd586816 150 const uint16_t SL_OPCODE_DEVICE_ABORT = 0x000C;
dflet 0:50cedd586816 151 const uint16_t SL_OPCODE_DEVICE_STOP_COMMAND = 0x8473;
dflet 0:50cedd586816 152 const uint16_t SL_OPCODE_DEVICE_STOP_RESPONSE = 0x0473;
dflet 0:50cedd586816 153 const uint16_t SL_OPCODE_DEVICE_STOP_ASYNC_RESPONSE = 0x0073;
dflet 0:50cedd586816 154 const uint16_t SL_OPCODE_DEVICE_DEVICEASYNCDUMMY = 0x0063;
dflet 0:50cedd586816 155
dflet 0:50cedd586816 156 const uint16_t SL_OPCODE_DEVICE_VERSIONREADCOMMAND = 0x8470;
dflet 0:50cedd586816 157 const uint16_t SL_OPCODE_DEVICE_VERSIONREADRESPONSE = 0x0470;
dflet 0:50cedd586816 158 const uint16_t SL_OPCODE_DEVICE_DEVICEASYNCFATALERROR = 0x0078;
dflet 0:50cedd586816 159 const uint16_t SL_OPCODE_WLAN_WLANCONNECTCOMMAND = 0x8C80;
dflet 0:50cedd586816 160 const uint16_t SL_OPCODE_WLAN_WLANCONNECTRESPONSE = 0x0C80;
dflet 0:50cedd586816 161 const uint16_t SL_OPCODE_WLAN_WLANASYNCCONNECTEDRESPONSE = 0x0880;
dflet 0:50cedd586816 162 const uint16_t SL_OPCODE_WLAN_P2P_DEV_FOUND = 0x0830;
dflet 0:50cedd586816 163 const uint16_t SL_OPCODE_WLAN_CONNECTION_FAILED = 0x0831;
dflet 0:50cedd586816 164 const uint16_t SL_OPCODE_WLAN_P2P_NEG_REQ_RECEIVED = 0x0832;
dflet 0:50cedd586816 165
dflet 0:50cedd586816 166 const uint16_t SL_OPCODE_WLAN_WLANDISCONNECTCOMMAND = 0x8C81;
dflet 0:50cedd586816 167 const uint16_t SL_OPCODE_WLAN_WLANDISCONNECTRESPONSE = 0x0C81;
dflet 0:50cedd586816 168 const uint16_t SL_OPCODE_WLAN_WLANASYNCDISCONNECTEDRESPONSE = 0x0881;
dflet 0:50cedd586816 169 const uint16_t SL_OPCODE_WLAN_WLANCONNECTEAPCOMMAND = 0x8C82;
dflet 0:50cedd586816 170 const uint16_t SL_OPCODE_WLAN_WLANCONNECTEAPCRESPONSE = 0x0C82;
dflet 0:50cedd586816 171 const uint16_t SL_OPCODE_WLAN_PROFILEADDCOMMAND = 0x8C83;
dflet 0:50cedd586816 172 const uint16_t SL_OPCODE_WLAN_PROFILEADDRESPONSE = 0x0C83;
dflet 0:50cedd586816 173 const uint16_t SL_OPCODE_WLAN_PROFILEGETCOMMAND = 0x8C84;
dflet 0:50cedd586816 174 const uint16_t SL_OPCODE_WLAN_PROFILEGETRESPONSE = 0x0C84;
dflet 0:50cedd586816 175 const uint16_t SL_OPCODE_WLAN_PROFILEDELCOMMAND = 0x8C85;
dflet 0:50cedd586816 176 const uint16_t SL_OPCODE_WLAN_PROFILEDELRESPONSE = 0x0C85;
dflet 0:50cedd586816 177 const uint16_t SL_OPCODE_WLAN_POLICYSETCOMMAND = 0x8C86;
dflet 0:50cedd586816 178 const uint16_t SL_OPCODE_WLAN_POLICYSETRESPONSE = 0x0C86;
dflet 0:50cedd586816 179 const uint16_t SL_OPCODE_WLAN_POLICYGETCOMMAND = 0x8C87;
dflet 0:50cedd586816 180 const uint16_t SL_OPCODE_WLAN_POLICYGETRESPONSE = 0x0C87;
dflet 0:50cedd586816 181 const uint16_t SL_OPCODE_WLAN_FILTERADD = 0x8C88;
dflet 0:50cedd586816 182 const uint16_t SL_OPCODE_WLAN_FILTERADDRESPONSE = 0x0C88;
dflet 0:50cedd586816 183 const uint16_t SL_OPCODE_WLAN_FILTERGET = 0x8C89;
dflet 0:50cedd586816 184 const uint16_t SL_OPCODE_WLAN_FILTERGETRESPONSE = 0x0C89;
dflet 0:50cedd586816 185 const uint16_t SL_OPCODE_WLAN_FILTERDELETE = 0x8C8A;
dflet 0:50cedd586816 186 const uint16_t SL_OPCODE_WLAN_FILTERDELETERESPOSNE = 0x0C8A;
dflet 0:50cedd586816 187 const uint16_t SL_OPCODE_WLAN_WLANGETSTATUSCOMMAND = 0x8C8F;
dflet 0:50cedd586816 188 const uint16_t SL_OPCODE_WLAN_WLANGETSTATUSRESPONSE = 0x0C8F;
dflet 0:50cedd586816 189 const uint16_t SL_OPCODE_WLAN_STARTTXCONTINUESCOMMAND = 0x8CAA;
dflet 0:50cedd586816 190 const uint16_t SL_OPCODE_WLAN_STARTTXCONTINUESRESPONSE = 0x0CAA;
dflet 0:50cedd586816 191 const uint16_t SL_OPCODE_WLAN_STOPTXCONTINUESCOMMAND = 0x8CAB;
dflet 0:50cedd586816 192 const uint16_t SL_OPCODE_WLAN_STOPTXCONTINUESRESPONSE = 0x0CAB;
dflet 0:50cedd586816 193 const uint16_t SL_OPCODE_WLAN_STARTRXSTATCOMMAND = 0x8CAC;
dflet 0:50cedd586816 194 const uint16_t SL_OPCODE_WLAN_STARTRXSTATRESPONSE = 0x0CAC;
dflet 0:50cedd586816 195 const uint16_t SL_OPCODE_WLAN_STOPRXSTATCOMMAND = 0x8CAD;
dflet 0:50cedd586816 196 const uint16_t SL_OPCODE_WLAN_STOPRXSTATRESPONSE = 0x0CAD;
dflet 0:50cedd586816 197 const uint16_t SL_OPCODE_WLAN_GETRXSTATCOMMAND = 0x8CAF;
dflet 0:50cedd586816 198 const uint16_t SL_OPCODE_WLAN_GETRXSTATRESPONSE = 0x0CAF;
dflet 0:50cedd586816 199 const uint16_t SL_OPCODE_WLAN_POLICYSETCOMMANDNEW = 0x8CB0;
dflet 0:50cedd586816 200 const uint16_t SL_OPCODE_WLAN_POLICYSETRESPONSENEW = 0x0CB0;
dflet 0:50cedd586816 201 const uint16_t SL_OPCODE_WLAN_POLICYGETCOMMANDNEW = 0x8CB1;
dflet 0:50cedd586816 202 const uint16_t SL_OPCODE_WLAN_POLICYGETRESPONSENEW = 0x0CB1;
dflet 0:50cedd586816 203
dflet 0:50cedd586816 204 const uint16_t SL_OPCODE_WLAN_SMART_CONFIG_START_COMMAND = 0x8CB2;
dflet 0:50cedd586816 205 const uint16_t SL_OPCODE_WLAN_SMART_CONFIG_START_RESPONSE = 0x0CB2;
dflet 0:50cedd586816 206 const uint16_t SL_OPCODE_WLAN_SMART_CONFIG_START_ASYNC_RESPONSE = 0x08B2;
dflet 0:50cedd586816 207 const uint16_t SL_OPCODE_WLAN_SMART_CONFIG_STOP_COMMAND = 0x8CB3;
dflet 0:50cedd586816 208 const uint16_t SL_OPCODE_WLAN_SMART_CONFIG_STOP_RESPONSE = 0x0CB3;
dflet 0:50cedd586816 209 const uint16_t SL_OPCODE_WLAN_SMART_CONFIG_STOP_ASYNC_RESPONSE = 0x08B3;
dflet 0:50cedd586816 210 const uint16_t SL_OPCODE_WLAN_SET_MODE = 0x8CB4;
dflet 0:50cedd586816 211 const uint16_t SL_OPCODE_WLAN_SET_MODE_RESPONSE = 0x0CB4;
dflet 0:50cedd586816 212 const uint16_t SL_OPCODE_WLAN_CFG_SET = 0x8CB5;
dflet 0:50cedd586816 213 const uint16_t SL_OPCODE_WLAN_CFG_SET_RESPONSE = 0x0CB5;
dflet 0:50cedd586816 214 const uint16_t SL_OPCODE_WLAN_CFG_GET = 0x8CB6;
dflet 0:50cedd586816 215 const uint16_t SL_OPCODE_WLAN_CFG_GET_RESPONSE = 0x0CB6;
dflet 0:50cedd586816 216 const uint16_t SL_OPCODE_WLAN_STA_CONNECTED = 0x082E;
dflet 0:50cedd586816 217 const uint16_t SL_OPCODE_WLAN_STA_DISCONNECTED = 0x082F;
dflet 0:50cedd586816 218 const uint16_t SL_OPCODE_WLAN_EAP_PROFILEADDCOMMAND = 0x8C67;
dflet 0:50cedd586816 219 const uint16_t SL_OPCODE_WLAN_EAP_PROFILEADDCOMMAND_RESPONSE = 0x0C67;
dflet 0:50cedd586816 220
dflet 0:50cedd586816 221 const uint16_t SL_OPCODE_SOCKET_SOCKET = 0x9401;
dflet 0:50cedd586816 222 const uint16_t SL_OPCODE_SOCKET_SOCKETRESPONSE = 0x1401;
dflet 0:50cedd586816 223 const uint16_t SL_OPCODE_SOCKET_CLOSE = 0x9402;
dflet 0:50cedd586816 224 const uint16_t SL_OPCODE_SOCKET_CLOSERESPONSE = 0x1402;
dflet 0:50cedd586816 225 const uint16_t SL_OPCODE_SOCKET_ACCEPT = 0x9403;
dflet 0:50cedd586816 226 const uint16_t SL_OPCODE_SOCKET_ACCEPTRESPONSE = 0x1403;
dflet 0:50cedd586816 227 const uint16_t SL_OPCODE_SOCKET_ACCEPTASYNCRESPONSE = 0x1003;
dflet 0:50cedd586816 228 const uint16_t SL_OPCODE_SOCKET_ACCEPTASYNCRESPONSE_V6 = 0x1203;
dflet 0:50cedd586816 229 const uint16_t SL_OPCODE_SOCKET_BIND = 0x9404;
dflet 0:50cedd586816 230 const uint16_t SL_OPCODE_SOCKET_BIND_V6 = 0x9604;
dflet 0:50cedd586816 231 const uint16_t SL_OPCODE_SOCKET_BINDRESPONSE = 0x1404;
dflet 0:50cedd586816 232 const uint16_t SL_OPCODE_SOCKET_LISTEN = 0x9405;
dflet 0:50cedd586816 233 const uint16_t SL_OPCODE_SOCKET_LISTENRESPONSE = 0x1405;
dflet 0:50cedd586816 234 const uint16_t SL_OPCODE_SOCKET_CONNECT = 0x9406;
dflet 0:50cedd586816 235 const uint16_t SL_OPCODE_SOCKET_CONNECT_V6 = 0x9606;
dflet 0:50cedd586816 236 const uint16_t SL_OPCODE_SOCKET_CONNECTRESPONSE = 0x1406;
dflet 0:50cedd586816 237 const uint16_t SL_OPCODE_SOCKET_CONNECTASYNCRESPONSE = 0x1006;
dflet 0:50cedd586816 238 const uint16_t SL_OPCODE_SOCKET_SELECT = 0x9407;
dflet 0:50cedd586816 239 const uint16_t SL_OPCODE_SOCKET_SELECTRESPONSE = 0x1407;
dflet 0:50cedd586816 240 const uint16_t SL_OPCODE_SOCKET_SELECTASYNCRESPONSE = 0x1007;
dflet 0:50cedd586816 241 const uint16_t SL_OPCODE_SOCKET_SETSOCKOPT = 0x9408;
dflet 0:50cedd586816 242 const uint16_t SL_OPCODE_SOCKET_SETSOCKOPTRESPONSE = 0x1408;
dflet 0:50cedd586816 243 const uint16_t SL_OPCODE_SOCKET_GETSOCKOPT = 0x9409;
dflet 0:50cedd586816 244 const uint16_t SL_OPCODE_SOCKET_GETSOCKOPTRESPONSE = 0x1409;
dflet 0:50cedd586816 245 const uint16_t SL_OPCODE_SOCKET_RECV = 0x940A;
dflet 0:50cedd586816 246 const uint16_t SL_OPCODE_SOCKET_RECVASYNCRESPONSE = 0x100A;
dflet 0:50cedd586816 247 const uint16_t SL_OPCODE_SOCKET_RECVFROM = 0x940B;
dflet 0:50cedd586816 248 const uint16_t SL_OPCODE_SOCKET_RECVFROMASYNCRESPONSE = 0x100B;
dflet 0:50cedd586816 249 const uint16_t SL_OPCODE_SOCKET_RECVFROMASYNCRESPONSE_V6 = 0x120B;
dflet 0:50cedd586816 250 const uint16_t SL_OPCODE_SOCKET_SEND = 0x940C;
dflet 0:50cedd586816 251 const uint16_t SL_OPCODE_SOCKET_SENDTO = 0x940D;
dflet 0:50cedd586816 252 const uint16_t SL_OPCODE_SOCKET_SENDTO_V6 = 0x960D;
dflet 0:50cedd586816 253 const uint16_t SL_OPCODE_SOCKET_TXFAILEDASYNCRESPONSE = 0x100E;
dflet 0:50cedd586816 254 const uint16_t SL_OPCODE_SOCKET_SOCKETASYNCEVENT = 0x100F;
dflet 0:50cedd586816 255 const uint16_t SL_OPCODE_NETAPP_START_COMMAND = 0x9C0A;
dflet 0:50cedd586816 256 const uint16_t SL_OPCODE_NETAPP_START_RESPONSE = 0x1C0A;
dflet 0:50cedd586816 257 const uint16_t SL_OPCODE_NETAPP_NETAPPSTARTRESPONSE = 0x1C0A;
dflet 0:50cedd586816 258 const uint16_t SL_OPCODE_NETAPP_STOP_COMMAND = 0x9C61;
dflet 0:50cedd586816 259 const uint16_t SL_OPCODE_NETAPP_STOP_RESPONSE = 0x1C61;
dflet 0:50cedd586816 260 const uint16_t SL_OPCODE_NETAPP_NETAPPSET = 0x9C0B;
dflet 0:50cedd586816 261 const uint16_t SL_OPCODE_NETAPP_NETAPPSETRESPONSE = 0x1C0B;
dflet 0:50cedd586816 262 const uint16_t SL_OPCODE_NETAPP_NETAPPGET = 0x9C27;
dflet 0:50cedd586816 263 const uint16_t SL_OPCODE_NETAPP_NETAPPGETRESPONSE = 0x1C27;
dflet 0:50cedd586816 264 const uint16_t SL_OPCODE_NETAPP_DNSGETHOSTBYNAME = 0x9C20;
dflet 0:50cedd586816 265 const uint16_t SL_OPCODE_NETAPP_DNSGETHOSTBYNAMERESPONSE = 0x1C20;
dflet 0:50cedd586816 266 const uint16_t SL_OPCODE_NETAPP_DNSGETHOSTBYNAMEASYNCRESPONSE = 0x1820;
dflet 0:50cedd586816 267 const uint16_t SL_OPCODE_NETAPP_DNSGETHOSTBYNAMEASYNCRESPONSE_V6 = 0x1A20;
dflet 0:50cedd586816 268 const uint16_t SL_OPCODE_NETAPP_NETAPP_MDNS_LOOKUP_SERVICE = 0x9C71;
dflet 0:50cedd586816 269 const uint16_t SL_OPCODE_NETAPP_NETAPP_MDNS_LOOKUP_SERVICE_RESPONSE = 0x1C72;
dflet 0:50cedd586816 270 const uint16_t SL_OPCODE_NETAPP_MDNSREGISTERSERVICE = 0x9C34;
dflet 0:50cedd586816 271 const uint16_t SL_OPCODE_NETAPP_MDNSREGISTERSERVICERESPONSE = 0x1C34;
dflet 0:50cedd586816 272 const uint16_t SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICE = 0x9C35;
dflet 0:50cedd586816 273 const uint16_t SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICERESPONSE = 0x1C35;
dflet 0:50cedd586816 274 const uint16_t SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICEASYNCRESPONSE = 0x1835;
dflet 0:50cedd586816 275 const uint16_t SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICEASYNCRESPONSE_V6 = 0x1A35;
dflet 0:50cedd586816 276 const uint16_t SL_OPCODE_NETAPP_DNSGETHOSTBYADDR = 0x9C26;
dflet 0:50cedd586816 277 const uint16_t SL_OPCODE_NETAPP_DNSGETHOSTBYADDR_V6 = 0x9E26;
dflet 0:50cedd586816 278 const uint16_t SL_OPCODE_NETAPP_DNSGETHOSTBYADDRRESPONSE = 0x1C26;
dflet 0:50cedd586816 279 const uint16_t SL_OPCODE_NETAPP_DNSGETHOSTBYADDRASYNCRESPONSE = 0x1826;
dflet 0:50cedd586816 280 const uint16_t SL_OPCODE_NETAPP_PINGSTART = 0x9C21;
dflet 0:50cedd586816 281 const uint16_t SL_OPCODE_NETAPP_PINGSTART_V6 = 0x9E21;
dflet 0:50cedd586816 282 const uint16_t SL_OPCODE_NETAPP_PINGSTARTRESPONSE = 0x1C21;
dflet 0:50cedd586816 283 const uint16_t SL_OPCODE_NETAPP_PINGREPORTREQUEST = 0x9C22;
dflet 0:50cedd586816 284 const uint16_t SL_OPCODE_NETAPP_PINGREPORTREQUESTRESPONSE = 0x1822;
dflet 0:50cedd586816 285 const uint16_t SL_OPCODE_NETAPP_PINGSTOP = 0x9C23;
dflet 0:50cedd586816 286 const uint16_t SL_OPCODE_NETAPP_PINGSTOPRESPONSE = 0x1C23;
dflet 0:50cedd586816 287 const uint16_t SL_OPCODE_NETAPP_ARPFLUSH = 0x9C24;
dflet 0:50cedd586816 288 const uint16_t SL_OPCODE_NETAPP_ARPFLUSHRESPONSE = 0x1C24;
dflet 0:50cedd586816 289 const uint16_t SL_OPCODE_NETAPP_IPACQUIRED = 0x1825;
dflet 0:50cedd586816 290 const uint16_t SL_OPCODE_NETAPP_IPV4_LOST = 0x1832;
dflet 0:50cedd586816 291 const uint16_t SL_OPCODE_NETAPP_DHCP_IPV4_ACQUIRE_TIMEOUT = 0x1833;
dflet 0:50cedd586816 292 const uint16_t SL_OPCODE_NETAPP_IPACQUIRED_V6 = 0x1A25;
dflet 0:50cedd586816 293 const uint16_t SL_OPCODE_NETAPP_IPERFSTARTCOMMAND = 0x9C28;
dflet 0:50cedd586816 294 const uint16_t SL_OPCODE_NETAPP_IPERFSTARTRESPONSE = 0x1C28;
dflet 0:50cedd586816 295 const uint16_t SL_OPCODE_NETAPP_IPERFSTOPCOMMAND = 0x9C29;
dflet 0:50cedd586816 296 const uint16_t SL_OPCODE_NETAPP_IPERFSTOPRESPONSE = 0x1C29;
dflet 0:50cedd586816 297 const uint16_t SL_OPCODE_NETAPP_CTESTSTARTCOMMAND = 0x9C2A;
dflet 0:50cedd586816 298 const uint16_t SL_OPCODE_NETAPP_CTESTSTARTRESPONSE = 0x1C2A;
dflet 0:50cedd586816 299 const uint16_t SL_OPCODE_NETAPP_CTESTASYNCRESPONSE = 0x182A;
dflet 0:50cedd586816 300 const uint16_t SL_OPCODE_NETAPP_CTESTSTOPCOMMAND = 0x9C2B;
dflet 0:50cedd586816 301 const uint16_t SL_OPCODE_NETAPP_CTESTSTOPRESPONSE = 0x1C2B;
dflet 0:50cedd586816 302 const uint16_t SL_OPCODE_NETAPP_IP_LEASED = 0x182C;
dflet 0:50cedd586816 303 const uint16_t SL_OPCODE_NETAPP_IP_RELEASED = 0x182D;
dflet 0:50cedd586816 304 const uint16_t SL_OPCODE_NETAPP_HTTPGETTOKENVALUE = 0x182E;
dflet 0:50cedd586816 305 const uint16_t SL_OPCODE_NETAPP_HTTPSENDTOKENVALUE = 0x9C2F;
dflet 0:50cedd586816 306 const uint16_t SL_OPCODE_NETAPP_HTTPPOSTTOKENVALUE = 0x1830;
dflet 0:50cedd586816 307 const uint16_t SL_OPCODE_NVMEM_FILEOPEN = 0xA43C;
dflet 0:50cedd586816 308 const uint16_t SL_OPCODE_NVMEM_FILEOPENRESPONSE = 0x243C;
dflet 0:50cedd586816 309 const uint16_t SL_OPCODE_NVMEM_FILECLOSE = 0xA43D;
dflet 0:50cedd586816 310 const uint16_t SL_OPCODE_NVMEM_FILECLOSERESPONSE = 0x243D;
dflet 0:50cedd586816 311 const uint16_t SL_OPCODE_NVMEM_FILEREADCOMMAND = 0xA440;
dflet 0:50cedd586816 312 const uint16_t SL_OPCODE_NVMEM_FILEREADRESPONSE = 0x2440;
dflet 0:50cedd586816 313 const uint16_t SL_OPCODE_NVMEM_FILEWRITECOMMAND = 0xA441;
dflet 0:50cedd586816 314 const uint16_t SL_OPCODE_NVMEM_FILEWRITERESPONSE = 0x2441;
dflet 0:50cedd586816 315 const uint16_t SL_OPCODE_NVMEM_FILEGETINFOCOMMAND = 0xA442;
dflet 0:50cedd586816 316 const uint16_t SL_OPCODE_NVMEM_FILEGETINFORESPONSE = 0x2442;
dflet 0:50cedd586816 317 const uint16_t SL_OPCODE_NVMEM_FILEDELCOMMAND = 0xA443;
dflet 0:50cedd586816 318 const uint16_t SL_OPCODE_NVMEM_FILEDELRESPONSE = 0x2443;
dflet 0:50cedd586816 319 const uint16_t SL_OPCODE_NVMEM_NVMEMFORMATCOMMAND = 0xA444;
dflet 0:50cedd586816 320 const uint16_t SL_OPCODE_NVMEM_NVMEMFORMATRESPONSE = 0x2444;
dflet 0:50cedd586816 321
dflet 0:50cedd586816 322 const uint16_t SL_OPCODE_DEVICE_SETDEBUGLEVELCOMMAND = 0x846A;
dflet 0:50cedd586816 323 const uint16_t SL_OPCODE_DEVICE_SETDEBUGLEVELRESPONSE = 0x046A;
dflet 0:50cedd586816 324
dflet 0:50cedd586816 325 const uint16_t SL_OPCODE_DEVICE_NETCFG_SET_COMMAND = 0x8432;
dflet 0:50cedd586816 326 const uint16_t SL_OPCODE_DEVICE_NETCFG_SET_RESPONSE = 0x0432;
dflet 0:50cedd586816 327 const uint16_t SL_OPCODE_DEVICE_NETCFG_GET_COMMAND = 0x8433;
dflet 0:50cedd586816 328 const uint16_t SL_OPCODE_DEVICE_NETCFG_GET_RESPONSE = 0x0433;
dflet 0:50cedd586816 329 /* */
dflet 0:50cedd586816 330 const uint16_t SL_OPCODE_DEVICE_SETUARTMODECOMMAND = 0x846B;
dflet 0:50cedd586816 331 const uint16_t SL_OPCODE_DEVICE_SETUARTMODERESPONSE = 0x046B;
dflet 0:50cedd586816 332 const uint16_t SL_OPCODE_DEVICE_SSISIZESETCOMMAND = 0x846B;
dflet 0:50cedd586816 333 const uint16_t SL_OPCODE_DEVICE_SSISIZESETRESPONSE = 0x046B;
dflet 0:50cedd586816 334
dflet 0:50cedd586816 335 /* */
dflet 0:50cedd586816 336 const uint16_t SL_OPCODE_DEVICE_EVENTMASKSET = 0x8464;
dflet 0:50cedd586816 337 const uint16_t SL_OPCODE_DEVICE_EVENTMASKSETRESPONSE = 0x0464;
dflet 0:50cedd586816 338 const uint16_t SL_OPCODE_DEVICE_EVENTMASKGET = 0x8465;
dflet 0:50cedd586816 339 const uint16_t SL_OPCODE_DEVICE_EVENTMASKGETRESPONSE = 0x0465;
dflet 0:50cedd586816 340
dflet 0:50cedd586816 341 const uint16_t SL_OPCODE_DEVICE_DEVICEGET = 0x8466;
dflet 0:50cedd586816 342 const uint16_t SL_OPCODE_DEVICE_DEVICEGETRESPONSE = 0x0466;
dflet 0:50cedd586816 343 const uint16_t SL_OPCODE_DEVICE_DEVICESET = 0x84B7;
dflet 0:50cedd586816 344 const uint16_t SL_OPCODE_DEVICE_DEVICESETRESPONSE = 0x04B7;
dflet 0:50cedd586816 345
dflet 0:50cedd586816 346 const uint16_t SL_OPCODE_WLAN_SCANRESULTSGETCOMMAND = 0x8C8C;
dflet 0:50cedd586816 347 const uint16_t SL_OPCODE_WLAN_SCANRESULTSGETRESPONSE = 0x0C8C;
dflet 0:50cedd586816 348 const uint16_t SL_OPCODE_WLAN_SMARTCONFIGOPTSET = 0x8C8D;
dflet 0:50cedd586816 349 const uint16_t SL_OPCODE_WLAN_SMARTCONFIGOPTSETRESPONSE = 0x0C8D;
dflet 0:50cedd586816 350 const uint16_t SL_OPCODE_WLAN_SMARTCONFIGOPTGET = 0x8C8E;
dflet 0:50cedd586816 351 const uint16_t SL_OPCODE_WLAN_SMARTCONFIGOPTGETRESPONSE = 0x0C8E;
dflet 0:50cedd586816 352
dflet 0:50cedd586816 353
dflet 0:50cedd586816 354 /* Rx Filters opcodes */
dflet 0:50cedd586816 355 const uint16_t SL_OPCODE_WLAN_WLANRXFILTERADDCOMMAND = 0x8C6C;
dflet 0:50cedd586816 356 const uint16_t SL_OPCODE_WLAN_WLANRXFILTERADDRESPONSE = 0x0C6C;
dflet 0:50cedd586816 357 const uint16_t SL_OPCODE_WLAN_WLANRXFILTERSETCOMMAND = 0x8C6D;
dflet 0:50cedd586816 358 const uint16_t SL_OPCODE_WLAN_WLANRXFILTERSETRESPONSE = 0x0C6D;
dflet 0:50cedd586816 359 const uint16_t SL_OPCODE_WLAN_WLANRXFILTERGETSTATISTICSINFOCOMMAND = 0x8C6E;
dflet 0:50cedd586816 360 const uint16_t SL_OPCODE_WLAN_WLANRXFILTERGETSTATISTICSINFORESPONSE = 0x0C6E;
dflet 0:50cedd586816 361 const uint16_t SL_OPCODE_WLAN_WLANRXFILTERGETCOMMAND = 0x8C6F;
dflet 0:50cedd586816 362 const uint16_t SL_OPCODE_WLAN_WLANRXFILTERGETRESPONSE = 0x0C6F;
dflet 0:50cedd586816 363 const uint16_t SL_OPCODE_WLAN_WLANRXFILTERGETINFO = 0x8C70;
dflet 0:50cedd586816 364 const uint16_t SL_OPCODE_WLAN_WLANRXFILTERGETINFORESPONSE = 0x0C70;
dflet 0:50cedd586816 365
dflet 0:50cedd586816 366
dflet 0:50cedd586816 367 /******************************************************************************************/
dflet 0:50cedd586816 368 /* Device structs */
dflet 0:50cedd586816 369 /******************************************************************************************/
dflet 0:50cedd586816 370 typedef uint32_t InitStatus_t;
dflet 0:50cedd586816 371
dflet 0:50cedd586816 372
dflet 0:50cedd586816 373 typedef struct {
dflet 0:50cedd586816 374 int32_t Status;
dflet 0:50cedd586816 375 } InitComplete_t;
dflet 0:50cedd586816 376
dflet 0:50cedd586816 377 typedef struct {
dflet 0:50cedd586816 378 int16_t status;
dflet 0:50cedd586816 379 uint16_t padding;
dflet 0:50cedd586816 380
dflet 0:50cedd586816 381 } _BasicResponse_t;
dflet 0:50cedd586816 382
dflet 0:50cedd586816 383 typedef struct {
dflet 0:50cedd586816 384 uint16_t Timeout;
dflet 0:50cedd586816 385 uint16_t padding;
dflet 0:50cedd586816 386 } _DevStopCommand_t;
dflet 0:50cedd586816 387
dflet 0:50cedd586816 388 typedef struct {
dflet 0:50cedd586816 389 uint32_t group;
dflet 0:50cedd586816 390 uint32_t mask;
dflet 0:50cedd586816 391 } _DevMaskEventSetCommand_t;
dflet 0:50cedd586816 392
dflet 0:50cedd586816 393 typedef _BasicResponse_t _DevMaskEventSetResponse_t;
dflet 0:50cedd586816 394
dflet 0:50cedd586816 395
dflet 0:50cedd586816 396 typedef struct {
dflet 0:50cedd586816 397 uint32_t group;
dflet 0:50cedd586816 398 } _DevMaskEventGetCommand_t;
dflet 0:50cedd586816 399
dflet 0:50cedd586816 400
dflet 0:50cedd586816 401 typedef struct {
dflet 0:50cedd586816 402 uint32_t group;
dflet 0:50cedd586816 403 uint32_t mask;
dflet 0:50cedd586816 404 } _DevMaskEventGetResponse_t;
dflet 0:50cedd586816 405
dflet 0:50cedd586816 406
dflet 0:50cedd586816 407 typedef struct {
dflet 0:50cedd586816 408 uint32_t group;
dflet 0:50cedd586816 409 } _DevStatusGetCommand_t;
dflet 0:50cedd586816 410
dflet 0:50cedd586816 411
dflet 0:50cedd586816 412 typedef struct {
dflet 0:50cedd586816 413 uint32_t group;
dflet 0:50cedd586816 414 uint32_t status;
dflet 0:50cedd586816 415 } _DevStatusGetResponse_t;
dflet 0:50cedd586816 416
dflet 0:50cedd586816 417 typedef struct {
dflet 0:50cedd586816 418 uint32_t ChipId;
dflet 0:50cedd586816 419 uint32_t FwVersion[4];
dflet 0:50cedd586816 420 uint8_t PhyVersion[4];
dflet 0:50cedd586816 421 } _Device_VersionReadResponsePart_t;
dflet 0:50cedd586816 422
dflet 0:50cedd586816 423 typedef struct {
dflet 0:50cedd586816 424 _Device_VersionReadResponsePart_t part;
dflet 0:50cedd586816 425 uint32_t NwpVersion[4];
dflet 0:50cedd586816 426 uint16_t RomVersion;
dflet 0:50cedd586816 427 uint16_t Padding;
dflet 0:50cedd586816 428 } _Device_VersionReadResponseFull_t;
dflet 0:50cedd586816 429
dflet 0:50cedd586816 430
dflet 0:50cedd586816 431 typedef struct {
dflet 0:50cedd586816 432 uint32_t BaudRate;
dflet 0:50cedd586816 433 uint8_t FlowControlEnable;
dflet 0:50cedd586816 434 } _DevUartSetModeCommand_t;
dflet 0:50cedd586816 435
dflet 0:50cedd586816 436 typedef _BasicResponse_t _DevUartSetModeResponse_t;
dflet 0:50cedd586816 437
dflet 0:50cedd586816 438 /******************************************************/
dflet 0:50cedd586816 439
dflet 0:50cedd586816 440 typedef struct {
dflet 0:50cedd586816 441 uint8_t SsiSizeInBytes;
dflet 0:50cedd586816 442 uint8_t Padding[3];
dflet 0:50cedd586816 443 } _StellarisSsiSizeSet_t;
dflet 0:50cedd586816 444
dflet 0:50cedd586816 445 /*****************************************************************************************/
dflet 0:50cedd586816 446 /* WLAN structs */
dflet 0:50cedd586816 447 /*****************************************************************************************/
dflet 0:50cedd586816 448 #define MAXIMAL_PASSWORD_LENGTH (64)
dflet 0:50cedd586816 449
dflet 0:50cedd586816 450 typedef struct {
dflet 0:50cedd586816 451 uint8_t SecType;
dflet 0:50cedd586816 452 uint8_t SsidLen;
dflet 0:50cedd586816 453 uint8_t Bssid[6];
dflet 0:50cedd586816 454 uint8_t PasswordLen;
dflet 0:50cedd586816 455 } _WlanConnectCommon_t;
dflet 0:50cedd586816 456
dflet 0:50cedd586816 457 #define SSID_STRING(pCmd) (int8_t *)((_WlanConnectCommon_t *)(pCmd) + 1)
dflet 0:50cedd586816 458 #define PASSWORD_STRING(pCmd) (SSID_STRING(pCmd) + ((_WlanConnectCommon_t *)(pCmd))->SsidLen)
dflet 0:50cedd586816 459
dflet 0:50cedd586816 460 typedef struct {
dflet 0:50cedd586816 461 _WlanConnectCommon_t Common;
dflet 0:50cedd586816 462 uint8_t UserLen;
dflet 0:50cedd586816 463 uint8_t AnonUserLen;
dflet 0:50cedd586816 464 uint8_t CertIndex;
dflet 0:50cedd586816 465 uint32_t EapBitmask;
dflet 0:50cedd586816 466 } _WlanConnectEapCommand_t;
dflet 0:50cedd586816 467
dflet 0:50cedd586816 468 #define EAP_SSID_STRING(pCmd) (int8_t *)((_WlanConnectEapCommand_t *)(pCmd) + 1)
dflet 0:50cedd586816 469 #define EAP_PASSWORD_STRING(pCmd) (EAP_SSID_STRING(pCmd) + ((_WlanConnectEapCommand_t *)(pCmd))->Common.SsidLen)
dflet 0:50cedd586816 470 #define EAP_USER_STRING(pCmd) (EAP_PASSWORD_STRING(pCmd) + ((_WlanConnectEapCommand_t *)(pCmd))->Common.PasswordLen)
dflet 0:50cedd586816 471 #define EAP_ANON_USER_STRING(pCmd) (EAP_USER_STRING(pCmd) + ((_WlanConnectEapCommand_t *)(pCmd))->UserLen)
dflet 0:50cedd586816 472
dflet 0:50cedd586816 473
dflet 0:50cedd586816 474 typedef struct {
dflet 0:50cedd586816 475 uint8_t PolicyType;
dflet 0:50cedd586816 476 uint8_t Padding;
dflet 0:50cedd586816 477 uint8_t PolicyOption;
dflet 0:50cedd586816 478 uint8_t PolicyOptionLen;
dflet 0:50cedd586816 479 } _WlanPoliciySetGet_t;
dflet 0:50cedd586816 480
dflet 0:50cedd586816 481
dflet 0:50cedd586816 482 typedef struct {
dflet 0:50cedd586816 483 uint32_t minDwellTime;
dflet 0:50cedd586816 484 uint32_t maxDwellTime;
dflet 0:50cedd586816 485 uint32_t numProbeResponse;
dflet 0:50cedd586816 486 uint32_t G_Channels_mask;
dflet 0:50cedd586816 487 int32_t rssiThershold;
dflet 0:50cedd586816 488 int32_t snrThershold;
dflet 0:50cedd586816 489 int32_t defaultTXPower;
dflet 0:50cedd586816 490 uint16_t intervalList[16];
dflet 0:50cedd586816 491 } _WlanScanParamSetCommand_t;
dflet 0:50cedd586816 492
dflet 0:50cedd586816 493
dflet 0:50cedd586816 494 typedef struct {
dflet 0:50cedd586816 495 int8_t SecType;
dflet 0:50cedd586816 496 uint8_t SsidLen;
dflet 0:50cedd586816 497 uint8_t Priority;
dflet 0:50cedd586816 498 uint8_t Bssid[6];
dflet 0:50cedd586816 499 uint8_t PasswordLen;
dflet 0:50cedd586816 500 uint8_t WepKeyId;
dflet 0:50cedd586816 501 } _WlanAddGetProfile_t;
dflet 0:50cedd586816 502
dflet 0:50cedd586816 503
dflet 0:50cedd586816 504 typedef struct {
dflet 0:50cedd586816 505 _WlanAddGetProfile_t Common;
dflet 0:50cedd586816 506 uint8_t UserLen;
dflet 0:50cedd586816 507 uint8_t AnonUserLen;
dflet 0:50cedd586816 508 uint8_t CertIndex;
dflet 0:50cedd586816 509 uint16_t padding;
dflet 0:50cedd586816 510 uint32_t EapBitmask;
dflet 0:50cedd586816 511 } _WlanAddGetEapProfile_t;
dflet 0:50cedd586816 512
dflet 0:50cedd586816 513 #define PROFILE_SSID_STRING(pCmd) ((int8_t *)((_WlanAddGetProfile_t *)(pCmd) + 1))
dflet 0:50cedd586816 514 #define PROFILE_PASSWORD_STRING(pCmd) (PROFILE_SSID_STRING(pCmd) + ((_WlanAddGetProfile_t *)(pCmd))->SsidLen)
dflet 0:50cedd586816 515
dflet 0:50cedd586816 516 #define EAP_PROFILE_SSID_STRING(pCmd) (int8_t *)((_WlanAddGetEapProfile_t *)(pCmd) + 1)
dflet 0:50cedd586816 517 #define EAP_PROFILE_PASSWORD_STRING(pCmd) (EAP_PROFILE_SSID_STRING(pCmd) + ((_WlanAddGetEapProfile_t *)(pCmd))->Common.SsidLen)
dflet 0:50cedd586816 518 #define EAP_PROFILE_USER_STRING(pCmd) (EAP_PROFILE_PASSWORD_STRING(pCmd) + ((_WlanAddGetEapProfile_t *)(pCmd))->Common.PasswordLen)
dflet 0:50cedd586816 519 #define EAP_PROFILE_ANON_USER_STRING(pCmd) (EAP_PROFILE_USER_STRING(pCmd) + ((_WlanAddGetEapProfile_t *)(pCmd))->UserLen)
dflet 0:50cedd586816 520
dflet 0:50cedd586816 521 typedef struct {
dflet 0:50cedd586816 522 uint8_t index;
dflet 0:50cedd586816 523 uint8_t padding[3];
dflet 0:50cedd586816 524 } _WlanProfileDelGetCommand_t;
dflet 0:50cedd586816 525
dflet 0:50cedd586816 526 typedef _BasicResponse_t _WlanGetNetworkListResponse_t;
dflet 0:50cedd586816 527
dflet 0:50cedd586816 528 typedef struct {
dflet 0:50cedd586816 529 uint8_t index;
dflet 0:50cedd586816 530 uint8_t count;
dflet 0:50cedd586816 531 int8_t padding[2];
dflet 0:50cedd586816 532 } _WlanGetNetworkListCommand_t;
dflet 0:50cedd586816 533
dflet 0:50cedd586816 534
dflet 0:50cedd586816 535
dflet 0:50cedd586816 536
dflet 0:50cedd586816 537 typedef struct {
dflet 0:50cedd586816 538 uint32_t groupIdBitmask;
dflet 0:50cedd586816 539 uint8_t cipher;
dflet 0:50cedd586816 540 uint8_t publicKeyLen;
dflet 0:50cedd586816 541 uint8_t group1KeyLen;
dflet 0:50cedd586816 542 uint8_t group2KeyLen;
dflet 0:50cedd586816 543 } _WlanSmartConfigStartCommand_t;
dflet 0:50cedd586816 544
dflet 0:50cedd586816 545 #define SMART_CONFIG_START_PUBLIC_KEY_STRING(pCmd) ((int8_t *)((_WlanSmartConfigStartCommand_t *)(pCmd) + 1))
dflet 0:50cedd586816 546 #define SMART_CONFIG_START_GROUP1_KEY_STRING(pCmd) ((int8_t *) (SMART_CONFIG_START_PUBLIC_KEY_STRING(pCmd) + ((_WlanSmartConfigStartCommand_t *)(pCmd))->publicKeyLen))
dflet 0:50cedd586816 547 #define SMART_CONFIG_START_GROUP2_KEY_STRING(pCmd) ((int8_t *) (SMART_CONFIG_START_GROUP1_KEY_STRING(pCmd) + ((_WlanSmartConfigStartCommand_t *)(pCmd))->group1KeyLen))
dflet 0:50cedd586816 548
dflet 0:50cedd586816 549 typedef struct {
dflet 0:50cedd586816 550 uint8_t mode;
dflet 0:50cedd586816 551 uint8_t padding[3];
dflet 0:50cedd586816 552 } _WlanSetMode_t;
dflet 0:50cedd586816 553
dflet 0:50cedd586816 554
dflet 0:50cedd586816 555
dflet 0:50cedd586816 556
dflet 0:50cedd586816 557 typedef struct {
dflet 0:50cedd586816 558 uint16_t Status;
dflet 0:50cedd586816 559 uint16_t ConfigId;
dflet 0:50cedd586816 560 uint16_t ConfigOpt;
dflet 0:50cedd586816 561 uint16_t ConfigLen;
dflet 0:50cedd586816 562 } _WlanCfgSetGet_t;
dflet 0:50cedd586816 563
dflet 0:50cedd586816 564
dflet 0:50cedd586816 565 //wlan_rx_filters moved
dflet 0:50cedd586816 566
dflet 0:50cedd586816 567 typedef struct {
dflet 0:50cedd586816 568 uint16_t status;
dflet 0:50cedd586816 569 uint8_t WlanRole; /* 0 = station, 2 = AP */
dflet 0:50cedd586816 570 uint8_t Ipv6Enabled;
dflet 0:50cedd586816 571 uint8_t Ipv6DhcpEnabled;
dflet 0:50cedd586816 572
dflet 0:50cedd586816 573 uint32_t ipV6Global[4];
dflet 0:50cedd586816 574 uint32_t ipV6Local[4];
dflet 0:50cedd586816 575 uint32_t ipV6DnsServer[4];
dflet 0:50cedd586816 576 uint8_t Ipv6DhcpState;
dflet 0:50cedd586816 577
dflet 0:50cedd586816 578 } _NetappIpV6configRetArgs_t;
dflet 0:50cedd586816 579
dflet 0:50cedd586816 580
dflet 0:50cedd586816 581 typedef struct {
dflet 0:50cedd586816 582 uint8_t ipV4[4];
dflet 0:50cedd586816 583 uint8_t ipV4Mask[4];
dflet 0:50cedd586816 584 uint8_t ipV4Gateway[4];
dflet 0:50cedd586816 585 uint8_t ipV4DnsServer[4];
dflet 0:50cedd586816 586 uint8_t ipV4Start[4];
dflet 0:50cedd586816 587 uint8_t ipV4End[4];
dflet 0:50cedd586816 588 } _NetCfgIpV4AP_Args_t;
dflet 0:50cedd586816 589
dflet 0:50cedd586816 590
dflet 0:50cedd586816 591
dflet 0:50cedd586816 592 typedef struct {
dflet 0:50cedd586816 593 uint16_t status;
dflet 0:50cedd586816 594 uint8_t MacAddr[6];
dflet 0:50cedd586816 595 } _MAC_Address_SetGet_t;
dflet 0:50cedd586816 596
dflet 0:50cedd586816 597
dflet 0:50cedd586816 598 typedef struct {
dflet 0:50cedd586816 599 uint16_t Status;
dflet 0:50cedd586816 600 uint16_t ConfigId;
dflet 0:50cedd586816 601 uint16_t ConfigOpt;
dflet 0:50cedd586816 602 uint16_t ConfigLen;
dflet 0:50cedd586816 603 } _NetCfgSetGet_t;
dflet 0:50cedd586816 604
dflet 0:50cedd586816 605 typedef struct {
dflet 0:50cedd586816 606 uint16_t Status;
dflet 0:50cedd586816 607 uint16_t DeviceSetId;
dflet 0:50cedd586816 608 uint16_t Option;
dflet 0:50cedd586816 609 uint16_t ConfigLen;
dflet 0:50cedd586816 610 } _DeviceSetGet_t;
dflet 0:50cedd586816 611
dflet 0:50cedd586816 612
dflet 0:50cedd586816 613
dflet 0:50cedd586816 614
dflet 0:50cedd586816 615 /******************************************************************************************/
dflet 0:50cedd586816 616 /* Socket structs */
dflet 0:50cedd586816 617 /******************************************************************************************/
dflet 0:50cedd586816 618
dflet 0:50cedd586816 619 typedef struct {
dflet 0:50cedd586816 620 uint8_t Domain;
dflet 0:50cedd586816 621 uint8_t Type;
dflet 0:50cedd586816 622 uint8_t Protocol;
dflet 0:50cedd586816 623 uint8_t Padding;
dflet 0:50cedd586816 624 } _SocketCommand_t;
dflet 0:50cedd586816 625
dflet 0:50cedd586816 626
dflet 0:50cedd586816 627 typedef struct {
dflet 0:50cedd586816 628 int16_t statusOrLen;
dflet 0:50cedd586816 629 uint8_t sd;
dflet 0:50cedd586816 630 uint8_t padding;
dflet 0:50cedd586816 631 } _SocketResponse_t;
dflet 0:50cedd586816 632
dflet 0:50cedd586816 633 typedef struct {
dflet 0:50cedd586816 634 uint8_t sd;
dflet 0:50cedd586816 635 uint8_t family;
dflet 0:50cedd586816 636 uint8_t padding1;
dflet 0:50cedd586816 637 uint8_t padding2;
dflet 0:50cedd586816 638 } _AcceptCommand_t;
dflet 0:50cedd586816 639
dflet 0:50cedd586816 640
dflet 0:50cedd586816 641 typedef struct {
dflet 0:50cedd586816 642 int16_t statusOrLen;
dflet 0:50cedd586816 643 uint8_t sd;
dflet 0:50cedd586816 644 uint8_t family;
dflet 0:50cedd586816 645 uint16_t port;
dflet 0:50cedd586816 646 uint16_t paddingOrAddr;
dflet 0:50cedd586816 647 uint32_t address;
dflet 0:50cedd586816 648 } _SocketAddrAsyncIPv4Response_t;
dflet 0:50cedd586816 649
dflet 0:50cedd586816 650 typedef struct {
dflet 0:50cedd586816 651 int16_t statusOrLen;
dflet 0:50cedd586816 652 uint8_t sd;
dflet 0:50cedd586816 653 uint8_t family;
dflet 0:50cedd586816 654 uint16_t port;
dflet 0:50cedd586816 655 uint8_t address[6];
dflet 0:50cedd586816 656 } _SocketAddrAsyncIPv6EUI48Response_t;
dflet 0:50cedd586816 657 typedef struct {
dflet 0:50cedd586816 658 int16_t statusOrLen;
dflet 0:50cedd586816 659 uint8_t sd;
dflet 0:50cedd586816 660 uint8_t family;
dflet 0:50cedd586816 661 uint16_t port;
dflet 0:50cedd586816 662 uint16_t paddingOrAddr;
dflet 0:50cedd586816 663 uint32_t address[4];
dflet 0:50cedd586816 664 } _SocketAddrAsyncIPv6Response_t;
dflet 0:50cedd586816 665
dflet 0:50cedd586816 666
dflet 0:50cedd586816 667 typedef struct {
dflet 0:50cedd586816 668 int16_t lenOrPadding;
dflet 0:50cedd586816 669 uint8_t sd;
dflet 0:50cedd586816 670 uint8_t FamilyAndFlags;
dflet 0:50cedd586816 671 uint16_t port;
dflet 0:50cedd586816 672 uint16_t paddingOrAddr;
dflet 0:50cedd586816 673 uint32_t address;
dflet 0:50cedd586816 674 } _SocketAddrIPv4Command_t;
dflet 0:50cedd586816 675
dflet 0:50cedd586816 676 typedef struct {
dflet 0:50cedd586816 677 int16_t lenOrPadding;
dflet 0:50cedd586816 678 uint8_t sd;
dflet 0:50cedd586816 679 uint8_t FamilyAndFlags;
dflet 0:50cedd586816 680 uint16_t port;
dflet 0:50cedd586816 681 uint8_t address[6];
dflet 0:50cedd586816 682 } _SocketAddrIPv6EUI48Command_t;
dflet 0:50cedd586816 683 typedef struct {
dflet 0:50cedd586816 684 int16_t lenOrPadding;
dflet 0:50cedd586816 685 uint8_t sd;
dflet 0:50cedd586816 686 uint8_t FamilyAndFlags;
dflet 0:50cedd586816 687 uint16_t port;
dflet 0:50cedd586816 688 uint16_t paddingOrAddr;
dflet 0:50cedd586816 689 uint32_t address[4];
dflet 0:50cedd586816 690 } _SocketAddrIPv6Command_t;
dflet 0:50cedd586816 691
dflet 0:50cedd586816 692 typedef union {
dflet 0:50cedd586816 693 _SocketAddrIPv4Command_t IpV4;
dflet 0:50cedd586816 694 _SocketAddrIPv6EUI48Command_t IpV6EUI48;
dflet 0:50cedd586816 695 #ifdef SL_SUPPORT_IPV6
dflet 0:50cedd586816 696 _SocketAddrIPv6Command_t IpV6;
dflet 0:50cedd586816 697 #endif
dflet 0:50cedd586816 698 } _SocketAddrCommand_u;
dflet 0:50cedd586816 699
dflet 0:50cedd586816 700 typedef union {
dflet 0:50cedd586816 701 _SocketAddrAsyncIPv4Response_t IpV4;
dflet 0:50cedd586816 702 _SocketAddrAsyncIPv6EUI48Response_t IpV6EUI48;
dflet 0:50cedd586816 703 #ifdef SL_SUPPORT_IPV6
dflet 0:50cedd586816 704 _SocketAddrAsyncIPv6Response_t IpV6;
dflet 0:50cedd586816 705 #endif
dflet 0:50cedd586816 706 } _SocketAddrResponse_u;
dflet 0:50cedd586816 707
dflet 0:50cedd586816 708 typedef struct {
dflet 0:50cedd586816 709 uint8_t sd;
dflet 0:50cedd586816 710 uint8_t backlog;
dflet 0:50cedd586816 711 uint8_t padding1;
dflet 0:50cedd586816 712 uint8_t padding2;
dflet 0:50cedd586816 713 } _ListenCommand_t;
dflet 0:50cedd586816 714
dflet 0:50cedd586816 715 typedef struct {
dflet 0:50cedd586816 716 uint8_t sd;
dflet 0:50cedd586816 717 uint8_t padding0;
dflet 0:50cedd586816 718 uint8_t padding1;
dflet 0:50cedd586816 719 uint8_t padding2;
dflet 0:50cedd586816 720 } _CloseCommand_t;
dflet 0:50cedd586816 721
dflet 0:50cedd586816 722
dflet 0:50cedd586816 723 typedef struct {
dflet 0:50cedd586816 724 uint8_t nfds;
dflet 0:50cedd586816 725 uint8_t readFdsCount;
dflet 0:50cedd586816 726 uint8_t writeFdsCount;
dflet 0:50cedd586816 727 uint8_t padding;
dflet 0:50cedd586816 728 uint16_t readFds;
dflet 0:50cedd586816 729 uint16_t writeFds;
dflet 0:50cedd586816 730 uint16_t tv_usec;
dflet 0:50cedd586816 731 uint16_t tv_sec;
dflet 0:50cedd586816 732 } _SelectCommand_t;
dflet 0:50cedd586816 733
dflet 0:50cedd586816 734
dflet 0:50cedd586816 735 typedef struct {
dflet 0:50cedd586816 736 uint16_t status;
dflet 0:50cedd586816 737 uint8_t readFdsCount;
dflet 0:50cedd586816 738 uint8_t writeFdsCount;
dflet 0:50cedd586816 739 uint16_t readFds;
dflet 0:50cedd586816 740 uint16_t writeFds;
dflet 0:50cedd586816 741 } _SelectAsyncResponse_t;
dflet 0:50cedd586816 742
dflet 0:50cedd586816 743 typedef struct {
dflet 0:50cedd586816 744 uint8_t sd;
dflet 0:50cedd586816 745 uint8_t level;
dflet 0:50cedd586816 746 uint8_t optionName;
dflet 0:50cedd586816 747 uint8_t optionLen;
dflet 0:50cedd586816 748 } _setSockOptCommand_t;
dflet 0:50cedd586816 749
dflet 0:50cedd586816 750 typedef struct {
dflet 0:50cedd586816 751 uint8_t sd;
dflet 0:50cedd586816 752 uint8_t level;
dflet 0:50cedd586816 753 uint8_t optionName;
dflet 0:50cedd586816 754 uint8_t optionLen;
dflet 0:50cedd586816 755 } _getSockOptCommand_t;
dflet 0:50cedd586816 756
dflet 0:50cedd586816 757 typedef struct {
dflet 0:50cedd586816 758 int16_t status;
dflet 0:50cedd586816 759 uint8_t sd;
dflet 0:50cedd586816 760 uint8_t optionLen;
dflet 0:50cedd586816 761 } _getSockOptResponse_t;
dflet 0:50cedd586816 762
dflet 0:50cedd586816 763
dflet 0:50cedd586816 764 typedef struct {
dflet 0:50cedd586816 765 uint16_t StatusOrLen;
dflet 0:50cedd586816 766 uint8_t sd;
dflet 0:50cedd586816 767 uint8_t FamilyAndFlags;
dflet 0:50cedd586816 768 } _sendRecvCommand_t;
dflet 0:50cedd586816 769
dflet 0:50cedd586816 770 //netapp structs moved
dflet 0:50cedd586816 771
dflet 0:50cedd586816 772 /*****************************************************************************************
dflet 0:50cedd586816 773 * FS structs
dflet 0:50cedd586816 774 ******************************************************************************************/
dflet 0:50cedd586816 775
dflet 0:50cedd586816 776 typedef struct {
dflet 0:50cedd586816 777 uint32_t FileHandle;
dflet 0:50cedd586816 778 uint32_t Offset;
dflet 0:50cedd586816 779 uint16_t Len;
dflet 0:50cedd586816 780 uint16_t Padding;
dflet 0:50cedd586816 781 } _FsReadCommand_t;
dflet 0:50cedd586816 782
dflet 0:50cedd586816 783 typedef struct {
dflet 0:50cedd586816 784 uint32_t Mode;
dflet 0:50cedd586816 785 uint32_t Token;
dflet 0:50cedd586816 786 } _FsOpenCommand_t;
dflet 0:50cedd586816 787
dflet 0:50cedd586816 788 typedef struct {
dflet 0:50cedd586816 789 uint32_t FileHandle;
dflet 0:50cedd586816 790 uint32_t Token;
dflet 0:50cedd586816 791 } _FsOpenResponse_t;
dflet 0:50cedd586816 792
dflet 0:50cedd586816 793
dflet 0:50cedd586816 794 typedef struct {
dflet 0:50cedd586816 795 uint32_t FileHandle;
dflet 0:50cedd586816 796 uint32_t CertificFileNameLength;
dflet 0:50cedd586816 797 uint32_t SignatureLen;
dflet 0:50cedd586816 798 } _FsCloseCommand_t;
dflet 0:50cedd586816 799
dflet 0:50cedd586816 800
dflet 0:50cedd586816 801 typedef _BasicResponse_t _FsReadResponse_t;
dflet 0:50cedd586816 802 typedef _BasicResponse_t _FsDeleteResponse_t;
dflet 0:50cedd586816 803 typedef _BasicResponse_t _FsCloseResponse_t;
dflet 0:50cedd586816 804
dflet 0:50cedd586816 805 typedef struct {
dflet 0:50cedd586816 806 uint16_t Status;
dflet 0:50cedd586816 807 uint16_t flags;
dflet 0:50cedd586816 808 uint32_t FileLen;
dflet 0:50cedd586816 809 uint32_t AllocatedLen;
dflet 0:50cedd586816 810 uint32_t Token[4];
dflet 0:50cedd586816 811 } _FsGetInfoResponse_t;
dflet 0:50cedd586816 812
dflet 0:50cedd586816 813 typedef struct {
dflet 0:50cedd586816 814 uint8_t DeviceID;
dflet 0:50cedd586816 815 uint8_t Padding[3];
dflet 0:50cedd586816 816 } _FsFormatCommand_t;
dflet 0:50cedd586816 817
dflet 0:50cedd586816 818 typedef _BasicResponse_t _FsFormatResponse_t;
dflet 0:50cedd586816 819
dflet 0:50cedd586816 820 typedef struct {
dflet 0:50cedd586816 821 uint32_t Token;
dflet 0:50cedd586816 822 } _FsDeleteCommand_t;
dflet 0:50cedd586816 823
dflet 0:50cedd586816 824 typedef _FsDeleteCommand_t _FsGetInfoCommand_t;
dflet 0:50cedd586816 825
dflet 0:50cedd586816 826 typedef struct {
dflet 0:50cedd586816 827 uint32_t FileHandle;
dflet 0:50cedd586816 828 uint32_t Offset;
dflet 0:50cedd586816 829 uint16_t Len;
dflet 0:50cedd586816 830 uint16_t Padding;
dflet 0:50cedd586816 831 } _FsWriteCommand_t;
dflet 0:50cedd586816 832
dflet 0:50cedd586816 833 typedef _BasicResponse_t _FsWriteResponse_t;
dflet 0:50cedd586816 834
dflet 0:50cedd586816 835
dflet 0:50cedd586816 836 /* TODO: Set MAx Async Payload length depending on flavor (Tiny, Small, etc.) */
dflet 0:50cedd586816 837
dflet 0:50cedd586816 838 #ifdef SL_TINY_EXT
dflet 0:50cedd586816 839 #define SL_ASYNC_MAX_PAYLOAD_LEN 120 /* size must be aligned to 4 */
dflet 0:50cedd586816 840 #else
dflet 0:50cedd586816 841 #define SL_ASYNC_MAX_PAYLOAD_LEN 160 /* size must be aligned to 4 */
dflet 0:50cedd586816 842 #endif
dflet 0:50cedd586816 843 #define SL_ASYNC_MAX_MSG_LEN (_SL_RESP_HDR_SIZE + SL_ASYNC_MAX_PAYLOAD_LEN)
dflet 0:50cedd586816 844
dflet 0:50cedd586816 845 #define RECV_ARGS_SIZE (sizeof(_SocketResponse_t))
dflet 0:50cedd586816 846 #define RECVFROM_IPV4_ARGS_SIZE (sizeof(_SocketAddrAsyncIPv4Response_t))
dflet 0:50cedd586816 847 #define RECVFROM_IPV6_ARGS_SIZE (sizeof(_SocketAddrAsyncIPv6Response_t))
dflet 0:50cedd586816 848
dflet 0:50cedd586816 849 #define SL_IPV4_ADDRESS_SIZE (sizeof(uint32_t))
dflet 0:50cedd586816 850 #define SL_IPV6_ADDRESS_SIZE (4 * sizeof(uint32_t))
dflet 0:50cedd586816 851
dflet 0:50cedd586816 852 }//namespace mbed_cc3100
dflet 0:50cedd586816 853
dflet 0:50cedd586816 854 #endif /* _SL_PROTOCOL_TYPES_H_ */
dflet 0:50cedd586816 855