Update revision to use TI's mqtt and Freertos.

Dependencies:   mbed client server

Fork of cc3100_Test_mqtt_CM3 by David Fletcher

Committer:
dflet
Date:
Thu Sep 03 14:02:37 2015 +0000
Revision:
3:a8c249046181
SPI Mode change 1 to 0

Who changed what in which revision?

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