drivers, cc3k: Move cc3000 driver from stmhal to drivers directory.

This commit is contained in:
Damien George 2014-09-26 00:56:45 +01:00
parent 55a5b80793
commit f996d8854f
30 changed files with 3149 additions and 2601 deletions

View File

@ -35,9 +35,13 @@
#ifndef __COMMON_H__
#define __COMMON_H__
#include "data_types.h"
//******************************************************************************
// Include files
//******************************************************************************
#include <stdlib.h>
#include <stdint.h>
//*****************************************************************************
//
@ -49,6 +53,8 @@
extern "C" {
#endif
extern int errno;
//*****************************************************************************
// ERROR CODES
//*****************************************************************************
@ -68,8 +74,6 @@ extern "C" {
#define SP_PORTION_SIZE (32)
// #define CC3000_TINY_DRIVER
/*Defines for minimal and maximal RX buffer size. This size includes the spi
header and hci header.
The maximal buffer size derives from:
@ -143,8 +147,8 @@ extern "C" {
#ifndef CC3000_TINY_DRIVER
#define CC3000_RX_BUFFER_SIZE (CC3000_MINIMAL_RX_SIZE)
#define CC3000_TX_BUFFER_SIZE (CC3000_MINIMAL_TX_SIZE)
#define CC3000_RX_BUFFER_SIZE (CC3000_MAXIMAL_RX_SIZE)
#define CC3000_TX_BUFFER_SIZE (CC3000_MAXIMAL_TX_SIZE)
//if defined TINY DRIVER we use smaller RX and TX buffer in order to minimize RAM consumption
#else
@ -156,9 +160,9 @@ extern "C" {
//*****************************************************************************
// Compound Types
//*****************************************************************************
typedef long time_t;
typedef unsigned long clock_t;
typedef long suseconds_t;
typedef INT32 time_t;
typedef UINT32 clock_t;
typedef INT32 suseconds_t;
typedef struct timeval timeval;
@ -168,28 +172,28 @@ struct timeval
suseconds_t tv_usec; /* microseconds */
};
typedef char *(*tFWPatches)(unsigned long *usLength);
typedef CHAR *(*tFWPatches)(UINT32 *usLength);
typedef char *(*tDriverPatches)(unsigned long *usLength);
typedef CHAR *(*tDriverPatches)(UINT32 *usLength);
typedef char *(*tBootLoaderPatches)(unsigned long *usLength);
typedef CHAR *(*tBootLoaderPatches)(UINT32 *usLength);
typedef void (*tWlanCB)(long event_type, char * data, unsigned char length );
typedef void (*tWlanCB)(INT32 event_type, CHAR * data, UINT8 length );
typedef long (*tWlanReadInteruptPin)(void);
typedef INT32 (*tWlanReadInteruptPin)(void);
typedef void (*tWlanInterruptEnable)(void);
typedef void (*tWlanInterruptDisable)(void);
typedef void (*tWriteWlanPin)(unsigned char val);
typedef void (*tWriteWlanPin)(UINT8 val);
typedef struct
{
unsigned short usRxEventOpcode;
unsigned short usEventOrDataReceived;
unsigned char *pucReceivedData;
unsigned char *pucTxCommandBuffer;
UINT16 usRxEventOpcode;
UINT16 usEventOrDataReceived;
UINT8 *pucReceivedData;
UINT8 *pucTxCommandBuffer;
tFWPatches sFWPatches;
tDriverPatches sDriverPatches;
@ -200,16 +204,16 @@ typedef struct
tWlanInterruptDisable WlanInterruptDisable;
tWriteWlanPin WriteWlanPin;
signed long slTransmitDataError;
unsigned short usNumberOfFreeBuffers;
unsigned short usSlBufferLength;
unsigned short usBufferSize;
unsigned short usRxDataPending;
INT32 slTransmitDataError;
UINT16 usNumberOfFreeBuffers;
UINT16 usSlBufferLength;
UINT16 usBufferSize;
UINT16 usRxDataPending;
unsigned long NumberOfSentPackets;
unsigned long NumberOfReleasedPackets;
UINT32 NumberOfSentPackets;
UINT32 NumberOfReleasedPackets;
unsigned char InformHostOnTxComplete;
UINT8 InformHostOnTxComplete;
}sSimplLinkInformation;
extern volatile sSimplLinkInformation tSLInformation;
@ -235,7 +239,7 @@ extern volatile sSimplLinkInformation tSLInformation;
//
//*****************************************************************************
extern void SimpleLinkWaitEvent(unsigned short usOpcode, void *pRetParams);
extern void SimpleLinkWaitEvent(UINT16 usOpcode, void *pRetParams);
//*****************************************************************************
//
@ -253,7 +257,7 @@ extern void SimpleLinkWaitEvent(unsigned short usOpcode, void *pRetParams);
//
//*****************************************************************************
extern void SimpleLinkWaitData(unsigned char *pBuf, unsigned char *from, unsigned char *fromlen);
extern void SimpleLinkWaitData(UINT8 *pBuf, UINT8 *from, UINT8 *fromlen);
//*****************************************************************************
//
@ -269,7 +273,7 @@ extern void SimpleLinkWaitData(unsigned char *pBuf, unsigned char *from, unsigne
//
//*****************************************************************************
extern unsigned char* UINT32_TO_STREAM_f (unsigned char *p, unsigned long u32);
extern UINT8* UINT32_TO_STREAM_f (UINT8 *p, UINT32 u32);
//*****************************************************************************
//
@ -285,7 +289,7 @@ extern unsigned char* UINT32_TO_STREAM_f (unsigned char *p, unsigned long u32);
//
//*****************************************************************************
extern unsigned char* UINT16_TO_STREAM_f (unsigned char *p, unsigned short u16);
extern UINT8* UINT16_TO_STREAM_f (UINT8 *p, UINT16 u16);
//*****************************************************************************
//
@ -301,7 +305,7 @@ extern unsigned char* UINT16_TO_STREAM_f (unsigned char *p, unsigned short u16);
//
//*****************************************************************************
extern unsigned short STREAM_TO_UINT16_f(char* p, unsigned short offset);
extern UINT16 STREAM_TO_UINT16_f(CHAR* p, UINT16 offset);
//*****************************************************************************
//
@ -317,21 +321,7 @@ extern unsigned short STREAM_TO_UINT16_f(char* p, unsigned short offset);
//
//*****************************************************************************
extern unsigned long STREAM_TO_UINT32_f(char* p, unsigned short offset);
//*****************************************************************************
//
//! cc3k_int_poll
//!
//! \brief checks if the interrupt pin is low
//! just in case the hardware missed a falling edge
//! function is in ccspi.cpp
//
//*****************************************************************************
extern void cc3k_int_poll();
extern UINT32 STREAM_TO_UINT32_f(CHAR* p, UINT16 offset);
//*****************************************************************************
@ -346,14 +336,14 @@ extern void cc3k_int_poll();
//This macro is used for copying 32 bit to stream while converting to little endian format.
#define UINT32_TO_STREAM(_p, _u32) (UINT32_TO_STREAM_f(_p, _u32))
//This macro is used for copying a specified value length bits (l) to stream while converting to little endian format.
#define ARRAY_TO_STREAM(p, a, l) {register short _i; for (_i = 0; _i < l; _i++) *(p)++ = ((unsigned char *) a)[_i];}
#define ARRAY_TO_STREAM(p, a, l) {register INT16 _i; for (_i = 0; _i < l; _i++) *(p)++ = ((UINT8 *) a)[_i];}
//This macro is used for copying received stream to 8 bit in little endian format.
#define STREAM_TO_UINT8(_p, _offset, _u8) {_u8 = (unsigned char)(*(_p + _offset));}
#define STREAM_TO_UINT8(_p, _offset, _u8) {_u8 = (UINT8)(*(_p + _offset));}
//This macro is used for copying received stream to 16 bit in little endian format.
#define STREAM_TO_UINT16(_p, _offset, _u16) {_u16 = STREAM_TO_UINT16_f(_p, _offset);}
//This macro is used for copying received stream to 32 bit in little endian format.
#define STREAM_TO_UINT32(_p, _offset, _u32) {_u32 = STREAM_TO_UINT32_f(_p, _offset);}
#define STREAM_TO_STREAM(p, a, l) {register short _i; for (_i = 0; _i < l; _i++) *(a)++= ((unsigned char *) p)[_i];}
#define STREAM_TO_STREAM(p, a, l) {register INT16 _i; for (_i = 0; _i < l; _i++) *(a)++= ((UINT8 *) p)[_i];}

View File

@ -3,14 +3,6 @@
* spi.h - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Adapted for use with the Arduino/AVR by KTOWN (Kevin Townsend)
* & Limor Fried for Adafruit Industries
* This library works with the Adafruit CC3000 breakout
* ----> https://www.adafruit.com/products/1469
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@ -45,15 +37,18 @@
#ifndef __SPI_H__
#define __SPI_H__
//#include <string.h>
//#include <stdlib.h>
//#include <stdio.h>
//#include "wlan.h"
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*gcSpiHandleRx)(void *p);
typedef void (*gcSpiHandleTx)(void);
extern unsigned char wlan_tx_buffer[];
//*****************************************************************************
@ -61,23 +56,30 @@ extern unsigned char wlan_tx_buffer[];
// Prototypes for the APIs.
//
//*****************************************************************************
extern void SpiInit(void);
// the arguments must be of type pin_obj_t* and SPI_HandleTypeDef*
extern void SpiInit(void *spi, const void *pin_cs, const void *pin_en, const void *pin_irq);
extern void SpiOpen(gcSpiHandleRx pfRxHandler);
extern void SpiClose(void);
extern void SpiPauseSpi(void);
extern void SpiResumeSpi(void);
extern long SpiWrite(unsigned char *pUserBuffer, unsigned short usLength);
extern void SpiResumeSpi(void);
extern void SpiConfigureHwMapping(void);
extern void SpiCleanGPIOISR(void);
extern long TXBufferIsEmpty(void);
extern long RXBufferIsEmpty(void);
extern void CC3000_UsynchCallback(long lEventType, char * data, unsigned char length);
extern void WriteWlanPin( unsigned char val );
extern void SSIConfigure(unsigned long ulSSIFreq, unsigned long bForceGpioConfiguration, unsigned long uiReconfigureSysClock);
extern int init_spi(void);
extern long ReadWlanInterruptPin(void);
extern void WlanInterruptEnable();
extern void WlanInterruptDisable();
extern char *sendDriverPatch(unsigned long *Length);
extern char *sendBootLoaderPatch(unsigned long *Length);
extern char *sendWLFWPatch(unsigned long *Length);
extern void SpiIntGPIOHandler(void);
extern void WriteWlanPin(unsigned char val);
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif // __cplusplus
#endif

View File

@ -0,0 +1,107 @@
/*****************************************************************************
*
* data_types.h - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
#ifndef __DATA_TYPES__
#define __DATA_TYPES__
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C" {
#endif
#ifndef NULL
#define NULL (0)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
#ifndef OK
#define OK (0)
#endif
#ifndef _INT8
#define _INT8
typedef signed char INT8;
#endif
#ifndef _UINT8
#define _UINT8
typedef unsigned char UINT8;
#endif
#ifndef _INT16
#define _INT16
typedef signed short INT16;
#endif
#ifndef _UINT16
#define _UINT16
typedef unsigned short UINT16;
#endif
#ifndef _BOOLEAN
#define _BOOLEAN
typedef unsigned char BOOLEAN;
#endif
#ifndef _INT32
#define _INT32
typedef signed long INT32;
#endif
#ifndef _UINT32
#define _UINT32
typedef unsigned long UINT32;
#endif
typedef int INT;
typedef char CHAR;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __DATA_TYPE__ */

View File

@ -67,7 +67,7 @@ extern "C" {
//! event handler from global array of handlers pointers
//
//*****************************************************************************
extern unsigned char *hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen);
extern UINT8 *hci_event_handler(void *pRetParams, UINT8 *from, UINT8 *fromlen);
//*****************************************************************************
//
@ -81,7 +81,7 @@ extern unsigned char *hci_event_handler(void *pRetParams, unsigned char *from, u
//! @brief Handle unsolicited events
//
//*****************************************************************************
extern long hci_unsol_event_handler(char *event_hdr);
extern INT32 hci_unsol_event_handler(CHAR *event_hdr);
//*****************************************************************************
//
@ -95,9 +95,9 @@ extern long hci_unsol_event_handler(char *event_hdr);
//! corresponding event handler.
//
//*****************************************************************************
extern long hci_unsolicited_event_handler(void);
extern INT32 hci_unsolicited_event_handler(void);
#define M_BSD_RESP_PARAMS_OFFSET(hci_event_hdr)((char *)(hci_event_hdr) + HCI_EVENT_HEADER_SIZE)
#define M_BSD_RESP_PARAMS_OFFSET(hci_event_hdr)((CHAR *)(hci_event_hdr) + HCI_EVENT_HEADER_SIZE)
#define SOCKET_STATUS_ACTIVE 0
#define SOCKET_STATUS_INACTIVE 1
@ -107,15 +107,15 @@ extern long hci_unsolicited_event_handler(void);
#define M_IS_VALID_SD(sd) ((0 <= (sd)) && ((sd) <= 7))
#define M_IS_VALID_STATUS(status) (((status) == SOCKET_STATUS_ACTIVE)||((status) == SOCKET_STATUS_INACTIVE))
extern unsigned long socket_active_status;
extern UINT32 socket_active_status;
extern void set_socket_active_status(long Sd, long Status);
extern long get_socket_active_status(long Sd);
extern void set_socket_active_status(INT32 Sd, INT32 Status);
extern INT32 get_socket_active_status(INT32 Sd);
typedef struct _bsd_accept_return_t
{
long iSocketDescriptor;
long iStatus;
INT32 iSocketDescriptor;
INT32 iStatus;
sockaddr tSocketAddress;
} tBsdReturnParams;
@ -123,9 +123,9 @@ typedef struct _bsd_accept_return_t
typedef struct _bsd_read_return_t
{
long iSocketDescriptor;
long iNumberOfBytes;
unsigned long uiFlags;
INT32 iSocketDescriptor;
INT32 iNumberOfBytes;
UINT32 uiFlags;
} tBsdReadReturnParams;
#define BSD_RECV_FROM_FROMLEN_OFFSET (4)
@ -134,23 +134,23 @@ typedef struct _bsd_read_return_t
typedef struct _bsd_select_return_t
{
long iStatus;
unsigned long uiRdfd;
unsigned long uiWrfd;
unsigned long uiExfd;
INT32 iStatus;
UINT32 uiRdfd;
UINT32 uiWrfd;
UINT32 uiExfd;
} tBsdSelectRecvParams;
typedef struct _bsd_getsockopt_return_t
{
unsigned char ucOptValue[4];
char iStatus;
UINT8 ucOptValue[4];
CHAR iStatus;
} tBsdGetSockOptReturnParams;
typedef struct _bsd_gethostbyname_return_t
{
long retVal;
long outputAddress;
INT32 retVal;
INT32 outputAddress;
} tBsdGethostbynameParams;
//*****************************************************************************

View File

@ -102,6 +102,7 @@ extern "C" {
#define HCI_CMND_RECVFROM 0x100D
#define HCI_CMND_GETHOSTNAME 0x1010
#define HCI_CMND_MDNS_ADVERTISE 0x1011
#define HCI_CMND_GETMSSVALUE 0x1012
#define HCI_DATA_BASE 0x80
@ -167,6 +168,7 @@ extern "C" {
#define HCI_EVNT_GETSOCKOPT HCI_CMND_GETSOCKOPT
#define HCI_EVNT_BSD_GETHOSTBYNAME HCI_CMND_GETHOSTNAME
#define HCI_EVNT_MDNS_ADVERTISE HCI_CMND_MDNS_ADVERTISE
#define HCI_EVNT_GETMSSVALUE HCI_CMND_GETMSSVALUE
#define HCI_EVNT_SEND 0x1003
#define HCI_EVNT_WRITE 0x100E
@ -253,9 +255,9 @@ extern "C" {
//! @brief Initiate an HCI command.
//
//*****************************************************************************
extern unsigned short hci_command_send(unsigned short usOpcode,
unsigned char *ucArgs,
unsigned char ucArgsLength);
extern UINT16 hci_command_send(UINT16 usOpcode,
UINT8 *ucArgs,
UINT8 ucArgsLength);
//*****************************************************************************
@ -273,12 +275,12 @@ extern unsigned short hci_command_send(unsigned short usOpcode,
//! @brief Initiate an HCI data write operation
//
//*****************************************************************************
extern long hci_data_send(unsigned char ucOpcode,
unsigned char *ucArgs,
unsigned short usArgsLength,
unsigned short usDataLength,
const unsigned char *ucTail,
unsigned short usTailLength);
extern INT32 hci_data_send(UINT8 ucOpcode,
UINT8 *ucArgs,
UINT16 usArgsLength,
UINT16 usDataLength,
const UINT8 *ucTail,
UINT16 usTailLength);
//*****************************************************************************
@ -295,8 +297,8 @@ extern long hci_data_send(unsigned char ucOpcode,
//! @brief Prepare HCI header and initiate an HCI data write operation
//
//*****************************************************************************
extern void hci_data_command_send(unsigned short usOpcode, unsigned char *pucBuff,
unsigned char ucArgsLength, unsigned short ucDataLength);
extern void hci_data_command_send(UINT16 usOpcode, UINT8 *pucBuff,
UINT8 ucArgsLength, UINT16 ucDataLength);
//*****************************************************************************
//
@ -312,7 +314,7 @@ extern void hci_data_command_send(unsigned short usOpcode, unsigned char *pucBuf
//! @brief Prepare HCI header and initiate an HCI patch write operation
//
//*****************************************************************************
extern void hci_patch_send(unsigned char ucOpcode, unsigned char *pucBuff, char *patch, unsigned short usDataLength);
extern void hci_patch_send(UINT8 ucOpcode, UINT8 *pucBuff, CHAR *patch, UINT16 usDataLength);

View File

@ -35,7 +35,7 @@
#ifndef __HOST_DRIVER_VERSION_H__
#define __HOST_DRIVER_VERSION_H__
#define DRIVER_VERSION_NUMBER 14
#define DRIVER_VERSION_NUMBER 15

View File

@ -0,0 +1,4 @@
#ifndef __INET_NTOP_H
#define __INET_NTOP_H
char *inet_ntop(int af, const void *addr, char *buf, size_t size);
#endif /* __INET_NTOP_H */

View File

@ -0,0 +1,4 @@
#ifndef __INET_PTON_H
#define __INET_PTON_H
int inet_pton(int, const char *, void *);
#endif /* __INET_PTON_H */

View File

@ -35,6 +35,7 @@
#ifndef __NETAPP_H__
#define __NETAPP_H__
#include "data_types.h"
//*****************************************************************************
//
@ -55,33 +56,33 @@ extern "C" {
typedef struct _netapp_dhcp_ret_args_t
{
unsigned char aucIP[4];
unsigned char aucSubnetMask[4];
unsigned char aucDefaultGateway[4];
unsigned char aucDHCPServer[4];
unsigned char aucDNSServer[4];
UINT8 aucIP[4];
UINT8 aucSubnetMask[4];
UINT8 aucDefaultGateway[4];
UINT8 aucDHCPServer[4];
UINT8 aucDNSServer[4];
}tNetappDhcpParams;
typedef struct _netapp_ipconfig_ret_args_t
{
unsigned char aucIP[4];
unsigned char aucSubnetMask[4];
unsigned char aucDefaultGateway[4];
unsigned char aucDHCPServer[4];
unsigned char aucDNSServer[4];
unsigned char uaMacAddr[6];
unsigned char uaSSID[32];
UINT8 aucIP[4];
UINT8 aucSubnetMask[4];
UINT8 aucDefaultGateway[4];
UINT8 aucDHCPServer[4];
UINT8 aucDNSServer[4];
UINT8 uaMacAddr[6];
UINT8 uaSSID[32];
}tNetappIpconfigRetArgs;
/*Ping send report parameters*/
typedef struct _netapp_pingreport_args
{
unsigned long packets_sent;
unsigned long packets_received;
unsigned long min_round_time;
unsigned long max_round_time;
unsigned long avg_round_time;
UINT32 packets_sent;
UINT32 packets_received;
UINT32 min_round_time;
UINT32 max_round_time;
UINT32 avg_round_time;
} netapp_pingreport_args_t;
@ -99,7 +100,7 @@ typedef struct _netapp_pingreport_args
//! over resets.
//
//*****************************************************************************
extern long netapp_config_mac_adrress( unsigned char *mac );
extern INT32 netapp_config_mac_adrress( UINT8 *mac );
//*****************************************************************************
//
@ -127,7 +128,7 @@ extern long netapp_config_mac_adrress( unsigned char *mac );
//! AP was established.
//!
//*****************************************************************************
extern long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsigned long *aucDefaultGateway, unsigned long *aucDNSServer);
extern INT32 netapp_dhcp(UINT32 *aucIP, UINT32 *aucSubnetMask,UINT32 *aucDefaultGateway, UINT32 *aucDNSServer);
@ -140,7 +141,7 @@ extern long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsi
//! 0 or 0xffffffff == infinity lease timeout.
//! Resolution:10 seconds. Influence: only after
//! reconnecting to the AP.
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 20 seconds.
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 10 seconds.
//! The parameter is saved into the CC3000 NVMEM.
//! The default value on CC3000 is 14400 seconds.
//!
@ -149,7 +150,7 @@ extern long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsi
//! the end of the timeout.
//! Range: [0-0xffffffff] seconds, 0 == infinity ARP timeout
//! Resolution: 10 seconds. Influence: on runtime.
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 20 seconds
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 10 seconds
//! The parameter is saved into the CC3000 NVMEM.
//! The default value on CC3000 is 3600 seconds.
//!
@ -157,7 +158,7 @@ extern long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsi
//! Range: [0-0xffffffff] seconds, 0 == infinity timeout
//! Resolution: 10 seconds.
//! Influence: on runtime.
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 20 sec
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 10 sec
//! The parameter is saved into the CC3000 NVMEM.
//! The default value on CC3000 is 10 seconds.
//!
@ -166,7 +167,7 @@ extern long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsi
//! end of the socket timeout the socket will be closed
//! Range: [0-0xffffffff] sec, 0 == infinity timeout.
//! Resolution: 10 seconds. Influence: on runtime.
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 20 sec
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 10 sec
//! The parameter is saved into the CC3000 NVMEM.
//! The default value on CC3000 is 60 seconds.
//!
@ -176,12 +177,12 @@ extern long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsi
//! DHCP lease timeout, ARP refresh timeout, keepalive event
//! timeout and socket inactivity timeout
//!
//! @note If a parameter set to non zero value which is less than 20s,
//! it will be set automatically to 20s.
//! @note If a parameter set to non zero value which is less than 10s,
//! it will be set automatically to 10s.
//!
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
extern long netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,unsigned long *aucKeepalive, unsigned long *aucInactivity);
#ifndef CC3000_TINY_DRIVER
extern INT32 netapp_timeout_values(UINT32 *aucDHCP, UINT32 *aucARP, UINT32 *aucKeepalive, UINT32 *aucInactivity);
#endif
//*****************************************************************************
@ -206,7 +207,7 @@ extern long netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
extern long netapp_ping_send(unsigned long *ip, unsigned long ulPingAttempts, unsigned long ulPingSize, unsigned long ulPingTimeout);
extern INT32 netapp_ping_send(UINT32 *ip, UINT32 ulPingAttempts, UINT32 ulPingSize, UINT32 ulPingTimeout);
#endif
//*****************************************************************************
@ -223,7 +224,7 @@ extern long netapp_ping_send(unsigned long *ip, unsigned long ulPingAttempts, un
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
extern long netapp_ping_stop();
extern INT32 netapp_ping_stop();
#endif
//*****************************************************************************
//
@ -294,7 +295,7 @@ extern void netapp_ipconfig( tNetappIpconfigRetArgs * ipconfig );
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
extern long netapp_arp_flush();
extern INT32 netapp_arp_flush();
#endif
@ -318,7 +319,7 @@ extern long netapp_arp_flush();
#ifndef CC3000_TINY_DRIVER
long netapp_set_debug_level(unsigned long ulLevel);
INT32 netapp_set_debug_level(UINT32 ulLevel);
#endif
//*****************************************************************************
//

View File

@ -99,7 +99,7 @@ extern "C" {
//! @param ulOffset ulOffset in file from where to read
//! @param buff output buffer pointer
//!
//! @return number of bytes read, otherwise error.
//! @return on success 0, error otherwise.
//!
//! @brief Reads data from the file referred by the ulFileId parameter.
//! Reads data from file ulOffset till length. Err if the file can't
@ -107,7 +107,7 @@ extern "C" {
//!
//*****************************************************************************
extern signed long nvmem_read(unsigned long file_id, unsigned long length, unsigned long offset, unsigned char *buff);
extern INT32 nvmem_read(UINT32 file_id, UINT32 length, UINT32 offset, UINT8 *buff);
//*****************************************************************************
//
@ -131,7 +131,7 @@ extern signed long nvmem_read(unsigned long file_id, unsigned long length, unsig
//!
//*****************************************************************************
extern signed long nvmem_write(unsigned long ulFileId, unsigned long ulLength, unsigned long ulEntryOffset, unsigned char *buff);
extern INT32 nvmem_write(UINT32 ulFileId, UINT32 ulLength, UINT32 ulEntryOffset, UINT8 *buff);
//*****************************************************************************
@ -146,7 +146,7 @@ extern signed long nvmem_write(unsigned long ulFileId, unsigned long ulLength, u
//! mac address as appears over the air (OUI first)
//!
//*****************************************************************************
extern unsigned char nvmem_set_mac_address(unsigned char *mac);
extern UINT8 nvmem_set_mac_address(UINT8 *mac);
//*****************************************************************************
@ -161,7 +161,7 @@ extern unsigned char nvmem_set_mac_address(unsigned char *mac);
//! mac address as appears over the air (OUI first)
//!
//*****************************************************************************
extern unsigned char nvmem_get_mac_address(unsigned char *mac);
extern UINT8 nvmem_get_mac_address(UINT8 *mac);
//*****************************************************************************
@ -181,7 +181,7 @@ extern unsigned char nvmem_get_mac_address(unsigned char *mac);
//! applied in SP_PORTION_SIZE bytes portions.
//!
//*****************************************************************************
extern unsigned char nvmem_write_patch(unsigned long ulFileId, unsigned long spLength, const unsigned char *spData);
extern UINT8 nvmem_write_patch(UINT32 ulFileId, UINT32 spLength, const UINT8 *spData);
//*****************************************************************************
@ -198,7 +198,7 @@ extern unsigned char nvmem_write_patch(unsigned long ulFileId, unsigned long spL
//!
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
extern unsigned char nvmem_read_sp_version(unsigned char* patchVer);
extern UINT8 nvmem_read_sp_version(UINT8* patchVer);
#endif
//*****************************************************************************
@ -223,7 +223,7 @@ extern unsigned char nvmem_read_sp_version(unsigned char* patchVer);
//! set ulNewLen=0.
//!
//*****************************************************************************
extern signed long nvmem_create_entry(unsigned long file_id, unsigned long newlen);
extern INT32 nvmem_create_entry(UINT32 file_id, UINT32 newlen);
//*****************************************************************************

View File

@ -0,0 +1,11 @@
#ifndef __PATCH_PROG_H__
#define __PATCH_PROG_H__
extern unsigned short fw_length;
extern const unsigned char fw_patch[];
extern unsigned short drv_length;
extern const unsigned char wlan_drv_patch[];
extern const unsigned char cRMdefaultParams[128];
void patch_prog_start();
#endif //__PATCH_PROG_H__

View File

@ -69,7 +69,7 @@ extern "C" {
//!
//!
//*****************************************************************************
extern void aes_encrypt(unsigned char *state, unsigned char *key);
extern void aes_encrypt(UINT8 *state, UINT8 *key);
//*****************************************************************************
//
@ -87,7 +87,7 @@ extern void aes_encrypt(unsigned char *state, unsigned char *key);
//!
//!
//*****************************************************************************
extern void aes_decrypt(unsigned char *state, unsigned char *key);
extern void aes_decrypt(UINT8 *state, UINT8 *key);
//*****************************************************************************
@ -104,7 +104,7 @@ extern void aes_decrypt(unsigned char *state, unsigned char *key);
//!
//!
//*****************************************************************************
extern signed long aes_read_key(unsigned char *key);
extern INT32 aes_read_key(UINT8 *key);
//*****************************************************************************
//
@ -119,15 +119,10 @@ extern signed long aes_read_key(unsigned char *key);
//!
//!
//*****************************************************************************
extern signed long aes_write_key(unsigned char *key);
extern INT32 aes_write_key(UINT8 *key);
#endif //CC3000_UNENCRYPTED_SMART_CONFIG
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif // __cplusplus

View File

@ -99,9 +99,6 @@ extern "C" {
#define IOCTL_SOCKET_EVENTMASK
#ifdef ENOBUFS
#undef ENOBUFS
#endif
#define ENOBUFS 55 // No buffer space available
#define __FD_SETSIZE 32
@ -113,37 +110,33 @@ extern "C" {
typedef struct _in_addr_t
{
unsigned long s_addr; // load with inet_aton()
UINT32 s_addr; // load with inet_aton()
} in_addr;
typedef struct _sockaddr_t
{
unsigned short int sa_family;
unsigned char sa_data[14];
UINT16 sa_family;
UINT8 sa_data[14];
} sockaddr;
typedef struct _sockaddr_in_t
{
short sin_family; // e.g. AF_INET
unsigned short sin_port; // e.g. htons(3490)
INT16 sin_family; // e.g. AF_INET
UINT16 sin_port; // e.g. htons(3490)
in_addr sin_addr; // see struct in_addr, below
char sin_zero[8]; // zero this if you want to
CHAR sin_zero[8]; // zero this if you want to
} sockaddr_in;
typedef unsigned long socklen_t;
typedef UINT32 socklen_t;
// The fd_set member is required to be an array of longs.
typedef long int __fd_mask;
// The fd_set member is required to be an array of INT32s.
typedef INT32 __fd_mask;
// It's easier to assume 8-bit bytes than to get CHAR_BIT.
#define __NFDBITS (8 * sizeof (__fd_mask))
#define __FDELT(d) ((d) / __NFDBITS)
#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
#ifdef fd_set
#undef fd_set // for compatibility with newlib, which defines fd_set
#endif
// fd_set for select and pselect.
typedef struct
{
@ -155,7 +148,7 @@ typedef struct
// the array isn't too big.
#define __FD_ZERO(set) \
do { \
unsigned int __i; \
UINT16 __i; \
fd_set *__arr = (set); \
for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
__FDS_BITS (__arr)[__i] = 0; \
@ -165,18 +158,6 @@ typedef struct
#define __FD_ISSET(d, set) (__FDS_BITS (set)[__FDELT (d)] & __FDMASK (d))
// Access macros for 'fd_set'.
#ifdef FD_SET
#undef FD_SET
#endif
#ifdef FD_CLR
#undef FD_CLR
#endif
#ifdef FD_ISSET
#undef FD_ISSET
#endif
#ifdef FD_ZERO
#undef FD_ZERO
#endif
#define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp)
#define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp)
#define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp)
@ -184,16 +165,16 @@ typedef struct
//Use in case of Big Endian only
#define htonl(A) ((((unsigned long)(A) & 0xff000000) >> 24) | \
(((unsigned long)(A) & 0x00ff0000) >> 8) | \
(((unsigned long)(A) & 0x0000ff00) << 8) | \
(((unsigned long)(A) & 0x000000ff) << 24))
#define htonl(A) ((((UINT32)(A) & 0xff000000) >> 24) | \
(((UINT32)(A) & 0x00ff0000) >> 8) | \
(((UINT32)(A) & 0x0000ff00) << 8) | \
(((UINT32)(A) & 0x000000ff) << 24))
#define ntohl htonl
//Use in case of Big Endian only
#define htons(A) ((((unsigned long)(A) & 0xff00) >> 8) | \
(((unsigned long)(A) & 0x00ff) << 8))
#define htons(A) ((((UINT32)(A) & 0xff00) >> 8) | \
(((UINT32)(A) & 0x00ff) << 8))
#define ntohs htons
@ -234,7 +215,7 @@ typedef struct
//! application layer to obtain a socket handle.
//
//*****************************************************************************
extern int socket(long domain, long type, long protocol);
extern INT16 socket(INT32 domain, INT32 type, INT32 protocol);
//*****************************************************************************
//
@ -247,7 +228,7 @@ extern int socket(long domain, long type, long protocol);
//! @brief The socket function closes a created socket.
//
//*****************************************************************************
extern long closesocket(long sd);
extern INT32 closesocket(INT32 sd);
//*****************************************************************************
//
@ -293,7 +274,7 @@ extern long closesocket(long sd);
//! @sa socket ; bind ; listen
//
//*****************************************************************************
extern long accept(long sd, sockaddr *addr, socklen_t *addrlen);
extern INT32 accept(INT32 sd, sockaddr *addr, socklen_t *addrlen);
//*****************************************************************************
//
@ -317,7 +298,7 @@ extern long accept(long sd, sockaddr *addr, socklen_t *addrlen);
//! @sa socket ; accept ; listen
//
//*****************************************************************************
extern long bind(long sd, const sockaddr *addr, long addrlen);
extern INT32 bind(INT32 sd, const sockaddr *addr, INT32 addrlen);
//*****************************************************************************
//
@ -341,7 +322,7 @@ extern long bind(long sd, const sockaddr *addr, long addrlen);
//! @note On this version, backlog is not supported
//
//*****************************************************************************
extern long listen(long sd, long backlog);
extern INT32 listen(INT32 sd, INT32 backlog);
//*****************************************************************************
//
@ -362,7 +343,7 @@ extern long listen(long sd, long backlog);
//
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
extern int gethostbyname(const char* hostname, unsigned short usNameLen, unsigned long* out_ip_addr);
extern INT16 gethostbyname(CHAR * hostname, UINT16 usNameLen, UINT32* out_ip_addr);
#endif
@ -394,7 +375,7 @@ extern int gethostbyname(const char* hostname, unsigned short usNameLen, unsigne
//! @sa socket
//
//*****************************************************************************
extern long connect(long sd, const sockaddr *addr, long addrlen);
extern INT32 connect(INT32 sd, const sockaddr *addr, INT32 addrlen);
//*****************************************************************************
//
@ -433,7 +414,7 @@ extern long connect(long sd, const sockaddr *addr, long addrlen);
//! @sa socket
//
//*****************************************************************************
extern int select(long nfds, fd_set *readsds, fd_set *writesds,
extern INT16 select(INT32 nfds, fd_set *readsds, fd_set *writesds,
fd_set *exceptsds, struct timeval *timeout);
//*****************************************************************************
@ -474,7 +455,7 @@ extern int select(long nfds, fd_set *readsds, fd_set *writesds,
//! 1. SOCKOPT_RECV_TIMEOUT (optname)
//! SOCKOPT_RECV_TIMEOUT configures recv and recvfrom timeout
//! in milliseconds.
//! In that case optval should be pointer to unsigned long.
//! In that case optval should be pointer to UINT32.
//! 2. SOCKOPT_NONBLOCK (optname). sets the socket non-blocking mode on
//! or off.
//! In that case optval should be SOCK_ON or SOCK_OFF (optval).
@ -483,7 +464,7 @@ extern int select(long nfds, fd_set *readsds, fd_set *writesds,
//
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
extern int setsockopt(long sd, long level, long optname, const void *optval,
extern INT16 setsockopt(INT32 sd, INT32 level, INT32 optname, const void *optval,
socklen_t optlen);
#endif
//*****************************************************************************
@ -524,7 +505,7 @@ extern int setsockopt(long sd, long level, long optname, const void *optval,
//! 1. SOCKOPT_RECV_TIMEOUT (optname)
//! SOCKOPT_RECV_TIMEOUT configures recv and recvfrom timeout
//! in milliseconds.
//! In that case optval should be pointer to unsigned long.
//! In that case optval should be pointer to UINT32.
//! 2. SOCKOPT_NONBLOCK (optname). sets the socket non-blocking mode on
//! or off.
//! In that case optval should be SOCK_ON or SOCK_OFF (optval).
@ -532,7 +513,7 @@ extern int setsockopt(long sd, long level, long optname, const void *optval,
//! @sa setsockopt
//
//*****************************************************************************
extern int getsockopt(long sd, long level, long optname, void *optval,
extern INT16 getsockopt(INT32 sd, INT32 level, INT32 optname, void *optval,
socklen_t *optlen);
//*****************************************************************************
@ -556,7 +537,7 @@ extern int getsockopt(long sd, long level, long optname, void *optval,
//! @Note On this version, only blocking mode is supported.
//
//*****************************************************************************
extern int recv(long sd, void *buf, long len, long flags);
extern INT16 recv(INT32 sd, void *buf, INT32 len, INT32 flags);
//*****************************************************************************
//
@ -586,7 +567,7 @@ extern int recv(long sd, void *buf, long len, long flags);
//! @Note On this version, only blocking mode is supported.
//
//*****************************************************************************
extern int recvfrom(long sd, void *buf, long len, long flags, sockaddr *from,
extern INT16 recvfrom(INT32 sd, void *buf, INT32 len, INT32 flags, sockaddr *from,
socklen_t *fromlen);
//*****************************************************************************
@ -611,7 +592,7 @@ extern int recvfrom(long sd, void *buf, long len, long flags, sockaddr *from,
//
//*****************************************************************************
extern int send(long sd, const void *buf, long len, long flags);
extern INT16 send(INT32 sd, const void *buf, INT32 len, INT32 flags);
//*****************************************************************************
//
@ -639,7 +620,7 @@ extern int send(long sd, const void *buf, long len, long flags);
//
//*****************************************************************************
extern int sendto(long sd, const void *buf, long len, long flags,
extern INT16 sendto(INT32 sd, const void *buf, INT32 len, INT32 flags,
const sockaddr *to, socklen_t tolen);
//*****************************************************************************
@ -649,7 +630,7 @@ extern int sendto(long sd, const void *buf, long len, long flags,
//! @param[in] mdnsEnabled flag to enable/disable the mDNS feature
//! @param[in] deviceServiceName Service name as part of the published
//! canonical domain name
//! @param[in] deviceServiceNameLength Length of the service name
//! @param[in] deviceServiceNameLength Length of the service name - up to 32 chars
//!
//!
//! @return On success, zero is returned, return SOC_ERROR if socket was not
@ -658,7 +639,21 @@ extern int sendto(long sd, const void *buf, long len, long flags,
//! @brief Set CC3000 in mDNS advertiser mode in order to advertise itself.
//
//*****************************************************************************
extern int mdnsAdvertiser(unsigned short mdnsEnabled, char * deviceServiceName, unsigned short deviceServiceNameLength);
extern INT16 mdnsAdvertiser(UINT16 mdnsEnabled, CHAR * deviceServiceName, UINT16 deviceServiceNameLength);
//*****************************************************************************
//
//! getmssvalue
//!
//! @param[in] sd socket descriptor
//!
//! @return On success, returns the MSS value of a TCP connection
//!
//! @brief Returns the MSS value of a TCP connection according to the socket descriptor
//
//*****************************************************************************
extern UINT16 getmssvalue (INT32 sd);
//*****************************************************************************
//

View File

@ -141,7 +141,7 @@ extern void wlan_init( tWlanCB sWlanCB,
//!
//
//*****************************************************************************
extern void wlan_start(unsigned short usPatchesAvailableAtHost);
extern int wlan_start(UINT16 usPatchesAvailableAtHost);
//*****************************************************************************
//
@ -189,10 +189,10 @@ extern void wlan_stop(void);
//
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
extern long wlan_connect(unsigned long ulSecType, const char *ssid, long ssid_len,
unsigned char *bssid, unsigned char *key, long key_len);
extern INT32 wlan_connect(UINT32 ulSecType, CHAR *ssid, INT32 ssid_len,
UINT8 *bssid, UINT8 *key, INT32 key_len);
#else
extern long wlan_connect(const char *ssid, long ssid_len);
extern INT32 wlan_connect(CHAR *ssid, INT32 ssid_len);
#endif
@ -208,7 +208,7 @@ extern long wlan_connect(const char *ssid, long ssid_len);
//
//*****************************************************************************
extern long wlan_disconnect(void);
extern INT32 wlan_disconnect(void);
//*****************************************************************************
//
@ -225,7 +225,8 @@ extern long wlan_disconnect(void);
//! @param ucPf_OrKey security key
//! @param ulPassPhraseLen security key length for WPA\WPA2
//!
//! @return On success, zero is returned. On error, -1 is returned
//! @return On success, index (1-7) of the stored profile is returned.
//! On error, -1 is returned.
//!
//! @brief When auto start is enabled, the device connects to
//! station from the profiles table. Up to 7 profiles are supported.
@ -238,15 +239,15 @@ extern long wlan_disconnect(void);
//
//*****************************************************************************
extern long wlan_add_profile(unsigned long ulSecType, unsigned char* ucSsid,
unsigned long ulSsidLen,
unsigned char *ucBssid,
unsigned long ulPriority,
unsigned long ulPairwiseCipher_Or_Key,
unsigned long ulGroupCipher_TxKeyLen,
unsigned long ulKeyMgmt,
unsigned char* ucPf_OrKey,
unsigned long ulPassPhraseLen);
extern INT32 wlan_add_profile(UINT32 ulSecType, UINT8* ucSsid,
UINT32 ulSsidLen,
UINT8 *ucBssid,
UINT32 ulPriority,
UINT32 ulPairwiseCipher_Or_Key,
UINT32 ulGroupCipher_TxKeyLen,
UINT32 ulKeyMgmt,
UINT8* ucPf_OrKey,
UINT32 ulPassPhraseLen);
@ -265,7 +266,7 @@ extern long wlan_add_profile(unsigned long ulSecType, unsigned char* ucSsid,
//! @sa wlan_add_profile
//
//*****************************************************************************
extern long wlan_ioctl_del_profile(unsigned long ulIndex);
extern INT32 wlan_ioctl_del_profile(UINT32 ulIndex);
//*****************************************************************************
//
@ -288,7 +289,7 @@ extern long wlan_ioctl_del_profile(unsigned long ulIndex);
//! masked (1), the device will not send the masked event to host.
//
//*****************************************************************************
extern long wlan_set_event_mask(unsigned long ulMask);
extern INT32 wlan_set_event_mask(UINT32 ulMask);
//*****************************************************************************
//
@ -302,7 +303,7 @@ extern long wlan_set_event_mask(unsigned long ulMask);
//! @brief get wlan status: disconnected, scanning, connecting or connected
//
//*****************************************************************************
extern long wlan_ioctl_statusget(void);
extern INT32 wlan_ioctl_statusget(void);
//*****************************************************************************
@ -336,10 +337,10 @@ extern long wlan_ioctl_statusget(void);
//! @sa wlan_add_profile , wlan_ioctl_del_profile
//
//*****************************************************************************
extern long wlan_ioctl_set_connection_policy(
unsigned long should_connect_to_open_ap,
unsigned long should_use_fast_connect,
unsigned long ulUseProfiles);
extern INT32 wlan_ioctl_set_connection_policy(
UINT32 should_connect_to_open_ap,
UINT32 should_use_fast_connect,
UINT32 ulUseProfiles);
//*****************************************************************************
//
@ -376,8 +377,8 @@ extern long wlan_ioctl_set_connection_policy(
//*****************************************************************************
extern long wlan_ioctl_get_scan_results(unsigned long ulScanTimeout,
unsigned char *ucResults);
extern INT32 wlan_ioctl_get_scan_results(UINT32 ulScanTimeout,
UINT8 *ucResults);
//*****************************************************************************
//
@ -403,7 +404,7 @@ extern long wlan_ioctl_get_scan_results(unsigned long ulScanTimeout,
//! @param uiSNRThreshold NSR threshold. Saved: yes (Default: 0)
//! @param uiDefaultTxPower probe Tx power. Saved: yes (Default: 205)
//! @param aiIntervalList pointer to array with 16 entries (16 channels)
//! each entry (unsigned long) holds timeout between periodic scan
//! each entry (UINT32) holds timeout between periodic scan
//! (connection scan) - in milliseconds. Saved: yes. Default 2000ms.
//!
//! @return On success, zero is returned. On error, -1 is returned
@ -415,13 +416,13 @@ extern long wlan_ioctl_get_scan_results(unsigned long ulScanTimeout,
//! @sa wlan_ioctl_get_scan_results
//
//*****************************************************************************
extern long wlan_ioctl_set_scan_params(unsigned long uiEnable, unsigned long
uiMinDwellTime,unsigned long uiMaxDwellTime,
unsigned long uiNumOfProbeRequests,
unsigned long uiChannelMask,
long iRSSIThreshold,unsigned long uiSNRThreshold,
unsigned long uiDefaultTxPower,
unsigned long *aiIntervalList);
extern INT32 wlan_ioctl_set_scan_params(UINT32 uiEnable, UINT32
uiMinDwellTime,UINT32 uiMaxDwellTime,
UINT32 uiNumOfProbeRequests,
UINT32 uiChannelMask,
INT32 iRSSIThreshold,UINT32 uiSNRThreshold,
UINT32 uiDefaultTxPower,
UINT32 *aiIntervalList);
//*****************************************************************************
@ -444,7 +445,7 @@ extern long wlan_ioctl_set_scan_params(unsigned long uiEnable, unsigned long
//! @sa wlan_smart_config_set_prefix , wlan_smart_config_stop
//
//*****************************************************************************
extern long wlan_smart_config_start(unsigned long algoEncryptedFlag);
extern INT32 wlan_smart_config_start(UINT32 algoEncryptedFlag);
//*****************************************************************************
@ -460,7 +461,7 @@ extern long wlan_smart_config_start(unsigned long algoEncryptedFlag);
//! @sa wlan_smart_config_start , wlan_smart_config_set_prefix
//
//*****************************************************************************
extern long wlan_smart_config_stop(void);
extern INT32 wlan_smart_config_stop(void);
//*****************************************************************************
//
@ -478,7 +479,7 @@ extern long wlan_smart_config_stop(void);
//! @sa wlan_smart_config_start , wlan_smart_config_stop
//
//*****************************************************************************
extern long wlan_smart_config_set_prefix(char* cNewPrefix);
extern INT32 wlan_smart_config_set_prefix(CHAR* cNewPrefix);
//*****************************************************************************
//
@ -494,7 +495,7 @@ extern long wlan_smart_config_set_prefix(char* cNewPrefix);
//! behavior is as defined by connection policy.
//
//*****************************************************************************
extern long wlan_smart_config_process(void);
extern INT32 wlan_smart_config_process(void);
//*****************************************************************************
//

View File

@ -39,14 +39,10 @@
//
//*****************************************************************************
/******************************************************************************
*
* Include files
*
*****************************************************************************/
#include <stdint.h>
#include "mpconfigport.h"
#if MICROPY_HW_ENABLE_CC3K
*
* Include files
*
*****************************************************************************/
#include "cc3000_common.h"
#include "socket.h"
@ -65,8 +61,7 @@
//! @brief stub function for ASSERT macro
//
//*****************************************************************************
void
__error__(char *pcFilename, unsigned long ulLine)
void __error__(CHAR *pcFilename, UINT32 ulLine)
{
//TODO full up function
}
@ -87,12 +82,12 @@ __error__(char *pcFilename, unsigned long ulLine)
//
//*****************************************************************************
unsigned char* UINT32_TO_STREAM_f (unsigned char *p, unsigned long u32)
UINT8* UINT32_TO_STREAM_f (UINT8 *p, UINT32 u32)
{
*(p)++ = (unsigned char)(u32);
*(p)++ = (unsigned char)((u32) >> 8);
*(p)++ = (unsigned char)((u32) >> 16);
*(p)++ = (unsigned char)((u32) >> 24);
*(p)++ = (UINT8)(u32);
*(p)++ = (UINT8)((u32) >> 8);
*(p)++ = (UINT8)((u32) >> 16);
*(p)++ = (UINT8)((u32) >> 24);
return p;
}
@ -110,10 +105,10 @@ unsigned char* UINT32_TO_STREAM_f (unsigned char *p, unsigned long u32)
//
//*****************************************************************************
unsigned char* UINT16_TO_STREAM_f (unsigned char *p, unsigned short u16)
UINT8* UINT16_TO_STREAM_f (UINT8 *p, UINT16 u16)
{
*(p)++ = (unsigned char)(u16);
*(p)++ = (unsigned char)((u16) >> 8);
*(p)++ = (UINT8)(u16);
*(p)++ = (UINT8)((u16) >> 8);
return p;
}
@ -131,10 +126,10 @@ unsigned char* UINT16_TO_STREAM_f (unsigned char *p, unsigned short u16)
//
//*****************************************************************************
unsigned short STREAM_TO_UINT16_f(char* p, unsigned short offset)
UINT16 STREAM_TO_UINT16_f(CHAR* p, UINT16 offset)
{
return (unsigned short)((unsigned short)((unsigned short)
(*(p + offset + 1)) << 8) + (unsigned short)(*(p + offset)));
return (UINT16)((UINT16)((UINT16)
(*(p + offset + 1)) << 8) + (UINT16)(*(p + offset)));
}
//*****************************************************************************
@ -151,12 +146,12 @@ unsigned short STREAM_TO_UINT16_f(char* p, unsigned short offset)
//
//*****************************************************************************
unsigned long STREAM_TO_UINT32_f(char* p, unsigned short offset)
UINT32 STREAM_TO_UINT32_f(CHAR* p, UINT16 offset)
{
return (unsigned long)((unsigned long)((unsigned long)
(*(p + offset + 3)) << 24) + (unsigned long)((unsigned long)
(*(p + offset + 2)) << 16) + (unsigned long)((unsigned long)
(*(p + offset + 1)) << 8) + (unsigned long)(*(p + offset)));
return (UINT32)((UINT32)((UINT32)
(*(p + offset + 3)) << 24) + (UINT32)((UINT32)
(*(p + offset + 2)) << 16) + (UINT32)((UINT32)
(*(p + offset + 1)) << 8) + (UINT32)(*(p + offset)));
}
@ -167,5 +162,3 @@ unsigned long STREAM_TO_UINT32_f(char* p, unsigned short offset)
//! @}
//
//*****************************************************************************
#endif // MICROPY_HW_ENABLE_CC3K

461
drivers/cc3000/src/ccspi.c Normal file
View File

@ -0,0 +1,461 @@
/*****************************************************************************
*
* spi.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
#include <string.h>
#include "stm32f4xx_hal.h"
#include "mpconfig.h"
#include "nlr.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
#include "pin.h"
#include "led.h"
#include "extint.h"
#include "spi.h"
#include "ccspi.h"
#include "evnt_handler.h"
#if 0 // print debugging info
#include <stdio.h>
#define DEBUG_printf(args...) printf(args)
#else // don't print debugging info
#define DEBUG_printf(args...) (void)0
#endif
// these need to be set to valid values before anything in this file will work
STATIC SPI_HandleTypeDef *SPI_HANDLE = NULL;
STATIC const pin_obj_t *PIN_CS = NULL;
STATIC const pin_obj_t *PIN_EN = NULL;
STATIC const pin_obj_t *PIN_IRQ = NULL;
#define CS_LOW() HAL_GPIO_WritePin(PIN_CS->gpio, PIN_CS->pin_mask, GPIO_PIN_RESET)
#define CS_HIGH() HAL_GPIO_WritePin(PIN_CS->gpio, PIN_CS->pin_mask, GPIO_PIN_SET)
#define READ 3
#define WRITE 1
#define HI(value) (((value) & 0xFF00) >> 8)
#define LO(value) ((value) & 0x00FF)
#define SPI_TIMEOUT (1000)
#define HEADERS_SIZE_EVNT (SPI_HEADER_SIZE + 5)
/* SPI bus states */
#define eSPI_STATE_POWERUP (0)
#define eSPI_STATE_INITIALIZED (1)
#define eSPI_STATE_IDLE (2)
#define eSPI_STATE_WRITE_IRQ (3)
#define eSPI_STATE_WRITE_FIRST_PORTION (4)
#define eSPI_STATE_WRITE_EOT (5)
#define eSPI_STATE_READ_IRQ (6)
#define eSPI_STATE_READ_FIRST_PORTION (7)
#define eSPI_STATE_READ_EOT (8)
// The magic number that resides at the end of the TX/RX buffer (1 byte after the allocated size)
// for the purpose of detection of the overrun. The location of the memory where the magic number
// resides shall never be written. In case it is written - the overrun occured and either recevie function
// or send function will stuck forever.
#define CC3000_BUFFER_MAGIC_NUMBER (0xDE)
typedef struct {
gcSpiHandleRx SPIRxHandler;
unsigned short usTxPacketLength;
unsigned short usRxPacketLength;
unsigned long ulSpiState;
unsigned char *pTxPacket;
unsigned char *pRxPacket;
} tSpiInformation;
tSpiInformation sSpiInformation;
char spi_buffer[CC3000_RX_BUFFER_SIZE];
unsigned char wlan_tx_buffer[CC3000_TX_BUFFER_SIZE];
STATIC const mp_obj_fun_builtin_t irq_callback_obj;
void SpiWriteDataSynchronous(unsigned char *data, unsigned short size);
void SpiReadDataSynchronous(unsigned char *data, unsigned short size);
// set the pins to use to communicate with the CC3000
// the arguments must be of type pin_obj_t* and SPI_HandleTypeDef*
void SpiInit(void *spi, const void *pin_cs, const void *pin_en, const void *pin_irq) {
SPI_HANDLE = spi;
PIN_CS = pin_cs;
PIN_EN = pin_en;
PIN_IRQ = pin_irq;
}
void SpiClose(void)
{
if (sSpiInformation.pRxPacket) {
sSpiInformation.pRxPacket = 0;
}
tSLInformation.WlanInterruptDisable();
//HAL_SPI_DeInit(SPI_HANDLE);
}
void SpiOpen(gcSpiHandleRx pfRxHandler)
{
DEBUG_printf("SpiOpen\n");
/* initialize SPI state */
sSpiInformation.ulSpiState = eSPI_STATE_POWERUP;
sSpiInformation.SPIRxHandler = pfRxHandler;
sSpiInformation.usTxPacketLength = 0;
sSpiInformation.pTxPacket = NULL;
sSpiInformation.pRxPacket = (unsigned char *)spi_buffer;
sSpiInformation.usRxPacketLength = 0;
spi_buffer[CC3000_RX_BUFFER_SIZE - 1] = CC3000_BUFFER_MAGIC_NUMBER;
wlan_tx_buffer[CC3000_TX_BUFFER_SIZE - 1] = CC3000_BUFFER_MAGIC_NUMBER;
/* SPI configuration */
SPI_HANDLE->Init.Mode = SPI_MODE_MASTER;
SPI_HANDLE->Init.Direction = SPI_DIRECTION_2LINES;
SPI_HANDLE->Init.DataSize = SPI_DATASIZE_8BIT;
SPI_HANDLE->Init.CLKPolarity = SPI_POLARITY_LOW;
SPI_HANDLE->Init.CLKPhase = SPI_PHASE_2EDGE;
SPI_HANDLE->Init.NSS = SPI_NSS_SOFT;
SPI_HANDLE->Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8;
SPI_HANDLE->Init.FirstBit = SPI_FIRSTBIT_MSB;
SPI_HANDLE->Init.TIMode = SPI_TIMODE_DISABLED;
SPI_HANDLE->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED;
SPI_HANDLE->Init.CRCPolynomial = 7;
spi_init(SPI_HANDLE);
// configure wlan CS and EN pins
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.Speed = GPIO_SPEED_FAST;
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Alternate = 0;
GPIO_InitStructure.Pin = PIN_CS->pin_mask;
HAL_GPIO_Init(PIN_CS->gpio, &GPIO_InitStructure);
GPIO_InitStructure.Pin = PIN_EN->pin_mask;
HAL_GPIO_Init(PIN_EN->gpio, &GPIO_InitStructure);
HAL_GPIO_WritePin(PIN_CS->gpio, PIN_CS->pin_mask, GPIO_PIN_SET);
HAL_GPIO_WritePin(PIN_EN->gpio, PIN_EN->pin_mask, GPIO_PIN_RESET);
/* do a dummy read, this ensures SCLK is low before
actual communications start, it might be required */
CS_LOW();
uint8_t buf[1];
HAL_SPI_Receive(SPI_HANDLE, buf, sizeof(buf), SPI_TIMEOUT);
CS_HIGH();
// register EXTI
extint_register((mp_obj_t)PIN_IRQ, GPIO_MODE_IT_FALLING, GPIO_PULLUP, (mp_obj_t)&irq_callback_obj, true, NULL);
extint_enable(PIN_IRQ->pin);
DEBUG_printf("SpiOpen finished; IRQ.pin=%d IRQ_LINE=%d\n", PIN_IRQ->pin, PIN_IRQ->pin);
}
void SpiPauseSpi(void)
{
extint_disable(PIN_IRQ->pin);
}
void SpiResumeSpi(void)
{
extint_enable(PIN_IRQ->pin);
}
long ReadWlanInterruptPin(void)
{
return HAL_GPIO_ReadPin(PIN_IRQ->gpio, PIN_IRQ->pin_mask);
}
void WriteWlanPin(unsigned char val)
{
HAL_GPIO_WritePin(PIN_EN->gpio, PIN_EN->pin_mask,
(WLAN_ENABLE)? GPIO_PIN_SET:GPIO_PIN_RESET);
}
void __delay_cycles(volatile int x)
{
x *= 6; // for 168 MHz CPU
while (x--);
}
long SpiFirstWrite(unsigned char *ucBuf, unsigned short usLength)
{
DEBUG_printf("SpiFirstWrite %lu\n", sSpiInformation.ulSpiState);
CS_LOW();
// Assuming we are running on 24 MHz ~50 micro delay is 1200 cycles;
__delay_cycles(1200);
// SPI writes first 4 bytes of data
SpiWriteDataSynchronous(ucBuf, 4);
__delay_cycles(1200);
SpiWriteDataSynchronous(ucBuf + 4, usLength - 4);
// From this point on - operate in a regular way
sSpiInformation.ulSpiState = eSPI_STATE_IDLE;
CS_HIGH();
return(0);
}
long SpiWrite(unsigned char *pUserBuffer, unsigned short usLength)
{
DEBUG_printf("SpiWrite %lu\n", sSpiInformation.ulSpiState);
unsigned char ucPad = 0;
// Figure out the total length of the packet in order to figure out if there
// is padding or not
if(!(usLength & 0x0001)) {
ucPad++;
}
pUserBuffer[0] = WRITE;
pUserBuffer[1] = HI(usLength + ucPad);
pUserBuffer[2] = LO(usLength + ucPad);
pUserBuffer[3] = 0;
pUserBuffer[4] = 0;
usLength += (SPI_HEADER_SIZE + ucPad);
// The magic number that resides at the end of the TX/RX buffer (1 byte after the allocated size)
// for the purpose of detection of the overrun. If the magic number is overriten - buffer overrun
// occurred - and we will stuck here forever!
if (wlan_tx_buffer[CC3000_TX_BUFFER_SIZE - 1] != CC3000_BUFFER_MAGIC_NUMBER) {
while (1);
}
if (sSpiInformation.ulSpiState == eSPI_STATE_POWERUP) {
while (sSpiInformation.ulSpiState != eSPI_STATE_INITIALIZED);
}
if (sSpiInformation.ulSpiState == eSPI_STATE_INITIALIZED) {
// This is time for first TX/RX transactions over SPI:
// the IRQ is down - so need to send read buffer size command
SpiFirstWrite(pUserBuffer, usLength);
} else {
//
// We need to prevent here race that can occur in case 2 back to back packets are sent to the
// device, so the state will move to IDLE and once again to not IDLE due to IRQ
//
tSLInformation.WlanInterruptDisable();
while (sSpiInformation.ulSpiState != eSPI_STATE_IDLE);
sSpiInformation.ulSpiState = eSPI_STATE_WRITE_IRQ;
sSpiInformation.pTxPacket = pUserBuffer;
sSpiInformation.usTxPacketLength = usLength;
// Assert the CS line and wait till SSI IRQ line is active and then initialize write operation
CS_LOW();
// Re-enable IRQ - if it was not disabled - this is not a problem...
tSLInformation.WlanInterruptEnable();
// check for a missing interrupt between the CS assertion and enabling back the interrupts
if (tSLInformation.ReadWlanInterruptPin() == 0) {
SpiWriteDataSynchronous(sSpiInformation.pTxPacket, sSpiInformation.usTxPacketLength);
sSpiInformation.ulSpiState = eSPI_STATE_IDLE;
CS_HIGH();
}
}
// Due to the fact that we are currently implementing a blocking situation
// here we will wait till end of transaction
while (eSPI_STATE_IDLE != sSpiInformation.ulSpiState);
return(0);
}
void SpiWriteDataSynchronous(unsigned char *data, unsigned short size)
{
DEBUG_printf("SpiWriteDataSynchronous(data=%p [%x %x %x %x], size=%u)\n", data, data[0], data[1], data[2], data[3], size);
__disable_irq();
if (HAL_SPI_TransmitReceive(SPI_HANDLE, data, data, size, SPI_TIMEOUT) != HAL_OK) {
//BREAK();
}
__enable_irq();
DEBUG_printf(" - rx data = [%x %x %x %x]\n", data[0], data[1], data[2], data[3]);
}
void SpiReadDataSynchronous(unsigned char *data, unsigned short size)
{
memset(data, READ, size);
__disable_irq();
if (HAL_SPI_TransmitReceive(SPI_HANDLE, data, data, size, SPI_TIMEOUT) != HAL_OK) {
//BREAK();
}
__enable_irq();
}
void SpiReadPacket(void)
{
int length;
/* read SPI header */
SpiReadDataSynchronous(sSpiInformation.pRxPacket, SPI_HEADER_SIZE);
/* parse data length */
STREAM_TO_UINT8(sSpiInformation.pRxPacket, SPI_HEADER_SIZE-1, length);
/* read the remainder of the packet */
SpiReadDataSynchronous(sSpiInformation.pRxPacket + SPI_HEADER_SIZE, length);
sSpiInformation.ulSpiState = eSPI_STATE_READ_EOT;
}
void SpiReadHeader(void)
{
SpiReadDataSynchronous(sSpiInformation.pRxPacket, 10);
}
void SpiTriggerRxProcessing(void)
{
SpiPauseSpi();
CS_HIGH();
// The magic number that resides at the end of the TX/RX buffer (1 byte after the allocated size)
// for the purpose of detection of the overrun. If the magic number is overriten - buffer overrun
// occurred - and we will stuck here forever!
if (sSpiInformation.pRxPacket[CC3000_RX_BUFFER_SIZE - 1] != CC3000_BUFFER_MAGIC_NUMBER) {
while (1);
}
sSpiInformation.ulSpiState = eSPI_STATE_IDLE;
sSpiInformation.SPIRxHandler(sSpiInformation.pRxPacket + SPI_HEADER_SIZE);
}
long SpiReadDataCont(void)
{
long data_to_recv=0;
unsigned char *evnt_buff, type;
//determine what type of packet we have
evnt_buff = sSpiInformation.pRxPacket;
STREAM_TO_UINT8((char *)(evnt_buff + SPI_HEADER_SIZE), HCI_PACKET_TYPE_OFFSET, type);
switch (type) {
case HCI_TYPE_DATA:{
// We need to read the rest of data..
STREAM_TO_UINT16((char *)(evnt_buff + SPI_HEADER_SIZE),
HCI_DATA_LENGTH_OFFSET, data_to_recv);
if (!((HEADERS_SIZE_EVNT + data_to_recv) & 1)) {
data_to_recv++;
}
if (data_to_recv) {
SpiReadDataSynchronous(evnt_buff + 10, data_to_recv);
}
break;
}
case HCI_TYPE_EVNT: {
// Calculate the rest length of the data
STREAM_TO_UINT8((char *)(evnt_buff + SPI_HEADER_SIZE),
HCI_EVENT_LENGTH_OFFSET, data_to_recv);
data_to_recv -= 1;
// Add padding byte if needed
if ((HEADERS_SIZE_EVNT + data_to_recv) & 1) {
data_to_recv++;
}
if (data_to_recv) {
SpiReadDataSynchronous(evnt_buff + 10, data_to_recv);
}
sSpiInformation.ulSpiState = eSPI_STATE_READ_EOT;
break;
}
}
return 0;
}
void SSIContReadOperation(void)
{
// The header was read - continue with the payload read
if (!SpiReadDataCont()) {
/* All the data was read - finalize handling by switching
to the task and calling from task Event Handler */
SpiTriggerRxProcessing();
}
}
STATIC mp_obj_t irq_callback(mp_obj_t line)
{
DEBUG_printf("<< IRQ; state=%lu >>\n", sSpiInformation.ulSpiState);
switch (sSpiInformation.ulSpiState) {
case eSPI_STATE_POWERUP:
/* This means IRQ line was low call a callback of HCI Layer to inform on event */
DEBUG_printf(" - POWERUP\n");
sSpiInformation.ulSpiState = eSPI_STATE_INITIALIZED;
break;
case eSPI_STATE_IDLE:
DEBUG_printf(" - IDLE\n");
sSpiInformation.ulSpiState = eSPI_STATE_READ_IRQ;
/* IRQ line goes down - we are start reception */
CS_LOW();
// Wait for TX/RX Compete which will come as DMA interrupt
SpiReadHeader();
sSpiInformation.ulSpiState = eSPI_STATE_READ_EOT;
SSIContReadOperation();
break;
case eSPI_STATE_WRITE_IRQ:
DEBUG_printf(" - WRITE IRQ\n");
SpiWriteDataSynchronous(sSpiInformation.pTxPacket, sSpiInformation.usTxPacketLength);
sSpiInformation.ulSpiState = eSPI_STATE_IDLE;
CS_HIGH();
break;
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(irq_callback_obj, irq_callback);

View File

@ -43,11 +43,6 @@
// INCLUDE FILES
//******************************************************************************
#include <stdint.h>
#include "mpconfigport.h"
#if MICROPY_HW_ENABLE_CC3K
#include "cc3000_common.h"
#include "string.h"
#include "hci.h"
@ -114,22 +109,22 @@
#define GET_SCAN_RESULTS_FRAME_TIME_OFFSET (10)
#define GET_SCAN_RESULTS_SSID_MAC_LENGTH (38)
#define GET_MSS_VAL_RETVAL_OFFSET (0)
//*****************************************************************************
// GLOBAL VARAIABLES
//*****************************************************************************
unsigned long socket_active_status = SOCKET_STATUS_INIT_VAL;
UINT32 socket_active_status = SOCKET_STATUS_INIT_VAL;
//*****************************************************************************
// Prototypes for the static functions
//*****************************************************************************
static long hci_event_unsol_flowcontrol_handler(char *pEvent);
static INT32 hci_event_unsol_flowcontrol_handler(CHAR *pEvent);
static void update_socket_active_status(char *resp_params);
static void update_socket_active_status(CHAR *resp_params);
//*****************************************************************************
@ -143,11 +138,11 @@ static void update_socket_active_status(char *resp_params);
//! @brief Handle unsolicited event from type patch request
//
//*****************************************************************************
void hci_unsol_handle_patch_request(char *event_hdr)
void hci_unsol_handle_patch_request(CHAR *event_hdr)
{
char *params = (char *)(event_hdr) + HCI_EVENT_HEADER_SIZE;
unsigned long ucLength = 0;
char *patch;
CHAR *params = (CHAR *)(event_hdr) + HCI_EVENT_HEADER_SIZE;
UINT32 ucLength = 0;
CHAR *patch;
switch (*params)
{
@ -229,16 +224,16 @@ void hci_unsol_handle_patch_request(char *event_hdr)
//*****************************************************************************
unsigned char *
hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
UINT8 * hci_event_handler(void *pRetParams, UINT8 *from, UINT8 *fromlen)
{
unsigned char *pucReceivedData, ucArgsize;
unsigned short usLength;
unsigned char *pucReceivedParams;
unsigned short usReceivedEventOpcode = 0;
unsigned long retValue32;
unsigned char * RecvParams;
unsigned char *RetParams;
UINT8 *pucReceivedData, ucArgsize;
UINT16 usLength;
UINT8 *pucReceivedParams;
UINT16 usReceivedEventOpcode = 0;
UINT32 retValue32;
UINT8 * RecvParams;
UINT8 *RetParams;
while (1)
{
@ -249,13 +244,14 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
if (*pucReceivedData == HCI_TYPE_EVNT)
{
// Event Received
STREAM_TO_UINT16((char *)pucReceivedData, HCI_EVENT_OPCODE_OFFSET, usReceivedEventOpcode);
STREAM_TO_UINT16((CHAR *)pucReceivedData, HCI_EVENT_OPCODE_OFFSET,
usReceivedEventOpcode);
pucReceivedParams = pucReceivedData + HCI_EVENT_HEADER_SIZE;
RecvParams = pucReceivedParams;
RetParams = pRetParams;
// In case unsolicited event received - here the handling finished
if (hci_unsol_event_handler((char *)pucReceivedData) == 0)
if (hci_unsol_event_handler((CHAR *)pucReceivedData) == 0)
{
STREAM_TO_UINT8(pucReceivedData, HCI_DATA_LENGTH_OFFSET, usLength);
@ -263,8 +259,10 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
{
case HCI_CMND_READ_BUFFER_SIZE:
{
STREAM_TO_UINT8((char *)pucReceivedParams, 0, tSLInformation.usNumberOfFreeBuffers);
STREAM_TO_UINT16((char *)pucReceivedParams, 1, tSLInformation.usSlBufferLength);
STREAM_TO_UINT8((CHAR *)pucReceivedParams, 0,
tSLInformation.usNumberOfFreeBuffers);
STREAM_TO_UINT16((CHAR *)pucReceivedParams, 1,
tSLInformation.usSlBufferLength);
}
break;
@ -281,7 +279,8 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
case HCI_NETAPP_PING_REPORT:
case HCI_EVNT_MDNS_ADVERTISE:
STREAM_TO_UINT8(pucReceivedData, HCI_EVENT_STATUS_OFFSET ,*(unsigned char *)pRetParams);
STREAM_TO_UINT8(pucReceivedData, HCI_EVENT_STATUS_OFFSET
,*(UINT8 *)pRetParams);
break;
case HCI_CMND_SETSOCKOPT:
@ -303,37 +302,46 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
case HCI_EVNT_CONNECT:
case HCI_EVNT_NVMEM_WRITE:
STREAM_TO_UINT32((char *)pucReceivedParams,0 ,*(unsigned long *)pRetParams);
STREAM_TO_UINT32((CHAR *)pucReceivedParams,0
,*(UINT32 *)pRetParams);
break;
case HCI_EVNT_READ_SP_VERSION:
STREAM_TO_UINT8(pucReceivedData, HCI_EVENT_STATUS_OFFSET ,*(unsigned char *)pRetParams);
pRetParams = ((char *)pRetParams) + 1;
STREAM_TO_UINT32((char *)pucReceivedParams, 0, retValue32);
UINT32_TO_STREAM((unsigned char *)pRetParams, retValue32);
STREAM_TO_UINT8(pucReceivedData, HCI_EVENT_STATUS_OFFSET
,*(UINT8 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 1;
STREAM_TO_UINT32((CHAR *)pucReceivedParams, 0, retValue32);
UINT32_TO_STREAM((UINT8 *)pRetParams, retValue32);
break;
case HCI_EVNT_BSD_GETHOSTBYNAME:
STREAM_TO_UINT32((char *)pucReceivedParams
,GET_HOST_BY_NAME_RETVAL_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((char *)pucReceivedParams
,GET_HOST_BY_NAME_ADDR_OFFSET,*(unsigned long *)pRetParams);
STREAM_TO_UINT32((CHAR *)pucReceivedParams
,GET_HOST_BY_NAME_RETVAL_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams
,GET_HOST_BY_NAME_ADDR_OFFSET,*(UINT32 *)pRetParams);
break;
case HCI_EVNT_GETMSSVALUE:
STREAM_TO_UINT16((CHAR *)pucReceivedParams
,GET_MSS_VAL_RETVAL_OFFSET,*(UINT16 *)pRetParams);
break;
case HCI_EVNT_ACCEPT:
{
STREAM_TO_UINT32((char *)pucReceivedParams,ACCEPT_SD_OFFSET
,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((char *)pucReceivedParams
,ACCEPT_RETURN_STATUS_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams,ACCEPT_SD_OFFSET
,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams
,ACCEPT_RETURN_STATUS_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
//This argument returns in network order
memcpy((unsigned char *)pRetParams,
memcpy((UINT8 *)pRetParams,
pucReceivedParams + ACCEPT_ADDRESS__OFFSET, sizeof(sockaddr));
break;
}
@ -341,11 +349,11 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
case HCI_EVNT_RECV:
case HCI_EVNT_RECVFROM:
{
STREAM_TO_UINT32((char *)pucReceivedParams,SL_RECEIVE_SD_OFFSET ,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((char *)pucReceivedParams,SL_RECEIVE_NUM_BYTES_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((char *)pucReceivedParams,SL_RECEIVE__FLAGS__OFFSET,*(unsigned long *)pRetParams);
STREAM_TO_UINT32((CHAR *)pucReceivedParams,SL_RECEIVE_SD_OFFSET ,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams,SL_RECEIVE_NUM_BYTES_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams,SL_RECEIVE__FLAGS__OFFSET,*(UINT32 *)pRetParams);
if(((tBsdReadReturnParams *)pRetParams)->iNumberOfBytes == ERROR_SOCKET_INACTIVE)
{
@ -357,23 +365,23 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
case HCI_EVNT_SEND:
case HCI_EVNT_SENDTO:
{
STREAM_TO_UINT32((char *)pucReceivedParams,SL_RECEIVE_SD_OFFSET ,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((char *)pucReceivedParams,SL_RECEIVE_NUM_BYTES_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams,SL_RECEIVE_SD_OFFSET ,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams,SL_RECEIVE_NUM_BYTES_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
break;
}
case HCI_EVNT_SELECT:
{
STREAM_TO_UINT32((char *)pucReceivedParams,SELECT_STATUS_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((char *)pucReceivedParams,SELECT_READFD_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((char *)pucReceivedParams,SELECT_WRITEFD_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((char *)pucReceivedParams,SELECT_EXFD_OFFSET,*(unsigned long *)pRetParams);
STREAM_TO_UINT32((CHAR *)pucReceivedParams,SELECT_STATUS_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams,SELECT_READFD_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams,SELECT_WRITEFD_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams,SELECT_EXFD_OFFSET,*(UINT32 *)pRetParams);
break;
}
@ -381,20 +389,20 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
STREAM_TO_UINT8(pucReceivedData, HCI_EVENT_STATUS_OFFSET,((tBsdGetSockOptReturnParams *)pRetParams)->iStatus);
//This argument returns in network order
memcpy((unsigned char *)pRetParams, pucReceivedParams, 4);
memcpy((UINT8 *)pRetParams, pucReceivedParams, 4);
break;
case HCI_CMND_WLAN_IOCTL_GET_SCAN_RESULTS:
STREAM_TO_UINT32((char *)pucReceivedParams,GET_SCAN_RESULTS_TABlE_COUNT_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT32((char *)pucReceivedParams,GET_SCAN_RESULTS_SCANRESULT_STATUS_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 4;
STREAM_TO_UINT16((char *)pucReceivedParams,GET_SCAN_RESULTS_ISVALID_TO_SSIDLEN_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 2;
STREAM_TO_UINT16((char *)pucReceivedParams,GET_SCAN_RESULTS_FRAME_TIME_OFFSET,*(unsigned long *)pRetParams);
pRetParams = ((char *)pRetParams) + 2;
memcpy((unsigned char *)pRetParams, (char *)(pucReceivedParams + GET_SCAN_RESULTS_FRAME_TIME_OFFSET + 2), GET_SCAN_RESULTS_SSID_MAC_LENGTH);
STREAM_TO_UINT32((CHAR *)pucReceivedParams,GET_SCAN_RESULTS_TABlE_COUNT_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
STREAM_TO_UINT32((CHAR *)pucReceivedParams,GET_SCAN_RESULTS_SCANRESULT_STATUS_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 4;
STREAM_TO_UINT16((CHAR *)pucReceivedParams,GET_SCAN_RESULTS_ISVALID_TO_SSIDLEN_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 2;
STREAM_TO_UINT16((CHAR *)pucReceivedParams,GET_SCAN_RESULTS_FRAME_TIME_OFFSET,*(UINT32 *)pRetParams);
pRetParams = ((CHAR *)pRetParams) + 2;
memcpy((UINT8 *)pRetParams, (CHAR *)(pucReceivedParams + GET_SCAN_RESULTS_FRAME_TIME_OFFSET + 2), GET_SCAN_RESULTS_SSID_MAC_LENGTH);
break;
case HCI_CMND_SIMPLE_LINK_START:
@ -428,7 +436,7 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
//Read SSID
STREAM_TO_STREAM(RecvParams,RetParams,NETAPP_IPCONFIG_SSID_LENGTH);
break;
}
}
@ -440,15 +448,15 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
else
{
pucReceivedParams = pucReceivedData;
STREAM_TO_UINT8((char *)pucReceivedData, HCI_PACKET_ARGSIZE_OFFSET, ucArgsize);
STREAM_TO_UINT8((CHAR *)pucReceivedData, HCI_PACKET_ARGSIZE_OFFSET, ucArgsize);
STREAM_TO_UINT16((char *)pucReceivedData, HCI_PACKET_LENGTH_OFFSET, usLength);
STREAM_TO_UINT16((CHAR *)pucReceivedData, HCI_PACKET_LENGTH_OFFSET, usLength);
// Data received: note that the only case where from and from length
// are not null is in recv from, so fill the args accordingly
if (from)
{
STREAM_TO_UINT32((char *)(pucReceivedData + HCI_DATA_HEADER_SIZE), BSD_RECV_FROM_FROMLEN_OFFSET, *(unsigned long *)fromlen);
STREAM_TO_UINT32((CHAR *)(pucReceivedData + HCI_DATA_HEADER_SIZE), BSD_RECV_FROM_FROMLEN_OFFSET, *(UINT32 *)fromlen);
memcpy(from, (pucReceivedData + HCI_DATA_HEADER_SIZE + BSD_RECV_FROM_FROM_OFFSET) ,*fromlen);
}
@ -467,7 +475,7 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
if ((*pucReceivedData == HCI_TYPE_EVNT) &&
(usReceivedEventOpcode == HCI_EVNT_PATCHES_REQ))
{
hci_unsol_handle_patch_request((char *)pucReceivedData);
hci_unsol_handle_patch_request((CHAR *)pucReceivedData);
}
if ((tSLInformation.usRxEventOpcode == 0) && (tSLInformation.usRxDataPending == 0))
@ -491,13 +499,12 @@ hci_event_handler(void *pRetParams, unsigned char *from, unsigned char *fromlen)
//! @brief Handle unsolicited events
//
//*****************************************************************************
long
hci_unsol_event_handler(char *event_hdr)
INT32 hci_unsol_event_handler(CHAR *event_hdr)
{
char * data = NULL;
long event_type;
unsigned long NumberOfReleasedPackets;
unsigned long NumberOfSentPackets;
CHAR * data = NULL;
INT32 event_type;
UINT32 NumberOfReleasedPackets;
UINT32 NumberOfSentPackets;
STREAM_TO_UINT16(event_hdr, HCI_EVENT_OPCODE_OFFSET,event_type);
@ -544,10 +551,10 @@ hci_unsol_event_handler(char *event_hdr)
case HCI_EVNT_WLAN_UNSOL_DHCP:
{
unsigned char params[NETAPP_IPCONFIG_MAC_OFFSET + 1]; // extra byte is for the status
unsigned char *recParams = params;
UINT8 params[NETAPP_IPCONFIG_MAC_OFFSET + 1]; // extra byte is for the status
UINT8 *recParams = params;
data = (char*)(event_hdr) + HCI_EVENT_HEADER_SIZE;
data = (CHAR*)(event_hdr) + HCI_EVENT_HEADER_SIZE;
//Read IP address
STREAM_TO_STREAM(data,recParams,NETAPP_IPCONFIG_IP_LENGTH);
@ -569,7 +576,7 @@ hci_unsol_event_handler(char *event_hdr)
if( tSLInformation.sWlanCB )
{
tSLInformation.sWlanCB(event_type, (char *)params, sizeof(params));
tSLInformation.sWlanCB(event_type, (CHAR *)params, sizeof(params));
}
}
break;
@ -577,7 +584,7 @@ hci_unsol_event_handler(char *event_hdr)
case HCI_EVNT_WLAN_ASYNC_PING_REPORT:
{
netapp_pingreport_args_t params;
data = (char*)(event_hdr) + HCI_EVENT_HEADER_SIZE;
data = (CHAR*)(event_hdr) + HCI_EVENT_HEADER_SIZE;
STREAM_TO_UINT32(data, NETAPP_PING_PACKETS_SENT_OFFSET, params.packets_sent);
STREAM_TO_UINT32(data, NETAPP_PING_PACKETS_RCVD_OFFSET, params.packets_received);
STREAM_TO_UINT32(data, NETAPP_PING_MIN_RTT_OFFSET, params.min_round_time);
@ -586,13 +593,13 @@ hci_unsol_event_handler(char *event_hdr)
if( tSLInformation.sWlanCB )
{
tSLInformation.sWlanCB(event_type, (char *)&params, sizeof(params));
tSLInformation.sWlanCB(event_type, (CHAR *)&params, sizeof(params));
}
}
break;
case HCI_EVNT_BSD_TCP_CLOSE_WAIT:
{
data = (char *)(event_hdr) + HCI_EVENT_HEADER_SIZE;
data = (CHAR *)(event_hdr) + HCI_EVENT_HEADER_SIZE;
if( tSLInformation.sWlanCB )
{
//data[0] represents the socket id, for which FIN was received by remote.
@ -613,8 +620,8 @@ hci_unsol_event_handler(char *event_hdr)
if ((event_type == HCI_EVNT_SEND) || (event_type == HCI_EVNT_SENDTO)
|| (event_type == HCI_EVNT_WRITE))
{
char *pArg;
long status;
CHAR *pArg;
INT32 status;
pArg = M_BSD_RESP_PARAMS_OFFSET(event_hdr);
STREAM_TO_UINT32(pArg, BSD_RSP_PARAMS_STATUS_OFFSET,status);
@ -654,11 +661,10 @@ hci_unsol_event_handler(char *event_hdr)
//! corresponding event handler.
//
//*****************************************************************************
long
hci_unsolicited_event_handler(void)
INT32 hci_unsolicited_event_handler(void)
{
unsigned long res = 0;
unsigned char *pucReceivedData;
UINT32 res = 0;
UINT8 *pucReceivedData;
if (tSLInformation.usEventOrDataReceived != 0)
{
@ -668,7 +674,7 @@ hci_unsolicited_event_handler(void)
{
// In case unsolicited event received - here the handling finished
if (hci_unsol_event_handler((char *)pucReceivedData) == 1)
if (hci_unsol_event_handler((CHAR *)pucReceivedData) == 1)
{
// There was an unsolicited event received - we can release the buffer
@ -696,7 +702,7 @@ hci_unsolicited_event_handler(void)
//! accordingly the global socket status
//
//*****************************************************************************
void set_socket_active_status(long Sd, long Status)
void set_socket_active_status(INT32 Sd, INT32 Status)
{
if(M_IS_VALID_SD(Sd) && M_IS_VALID_STATUS(Status))
{
@ -719,17 +725,16 @@ void set_socket_active_status(long Sd, long Status)
//! number of free buffer in the SL device.
//
//*****************************************************************************
long
hci_event_unsol_flowcontrol_handler(char *pEvent)
INT32 hci_event_unsol_flowcontrol_handler(CHAR *pEvent)
{
long temp, value;
unsigned short i;
unsigned short pusNumberOfHandles=0;
char *pReadPayload;
INT32 temp, value;
UINT16 i;
UINT16 pusNumberOfHandles=0;
CHAR *pReadPayload;
STREAM_TO_UINT16((char *)pEvent,HCI_EVENT_HEADER_SIZE,pusNumberOfHandles);
pReadPayload = ((char *)pEvent +
STREAM_TO_UINT16((CHAR *)pEvent,HCI_EVENT_HEADER_SIZE,pusNumberOfHandles);
pReadPayload = ((CHAR *)pEvent +
HCI_EVENT_HEADER_SIZE + sizeof(pusNumberOfHandles));
temp = 0;
@ -757,8 +762,7 @@ hci_event_unsol_flowcontrol_handler(char *pEvent)
//
//*****************************************************************************
long
get_socket_active_status(long Sd)
INT32 get_socket_active_status(INT32 Sd)
{
if(M_IS_VALID_SD(Sd))
{
@ -777,10 +781,9 @@ get_socket_active_status(long Sd)
//! @brief Retrieve socket status
//
//*****************************************************************************
void
update_socket_active_status(char *resp_params)
void update_socket_active_status(CHAR *resp_params)
{
long status, sd;
INT32 status, sd;
STREAM_TO_UINT32(resp_params, BSD_RSP_PARAMS_SOCKET_OFFSET,sd);
STREAM_TO_UINT32(resp_params, BSD_RSP_PARAMS_STATUS_OFFSET,status);
@ -806,8 +809,7 @@ update_socket_active_status(char *resp_params)
//
//*****************************************************************************
void
SimpleLinkWaitEvent(unsigned short usOpcode, void *pRetParams)
void SimpleLinkWaitEvent(UINT16 usOpcode, void *pRetParams)
{
// In the blocking implementation the control to caller will be returned only
// after the end of current transaction
@ -831,9 +833,7 @@ SimpleLinkWaitEvent(unsigned short usOpcode, void *pRetParams)
//
//*****************************************************************************
void
SimpleLinkWaitData(unsigned char *pBuf, unsigned char *from,
unsigned char *fromlen)
void SimpleLinkWaitData(UINT8 *pBuf, UINT8 *from, UINT8 *fromlen)
{
// In the blocking implementation the control to caller will be returned only
// after the end of current transaction, i.e. only after data will be received
@ -847,5 +847,3 @@ SimpleLinkWaitData(unsigned char *pBuf, unsigned char *from,
//! @}
//
//*****************************************************************************
#endif // MICROPY_HW_ENABLE_CC3K

View File

@ -40,12 +40,7 @@
//
//*****************************************************************************
#include <stdint.h>
#include <string.h> // for memcpy
#include "mpconfigport.h"
#if MICROPY_HW_ENABLE_CC3K
#include <string.h>
#include "cc3000_common.h"
#include "hci.h"
#include "ccspi.h"
@ -68,11 +63,9 @@
//! @brief Initiate an HCI command.
//
//*****************************************************************************
unsigned short
hci_command_send(unsigned short usOpcode, unsigned char *pucBuff,
unsigned char ucArgsLength)
UINT16 hci_command_send(UINT16 usOpcode, UINT8 *pucBuff, UINT8 ucArgsLength)
{
unsigned char *stream;
UINT8 *stream;
stream = (pucBuff + SPI_HEADER_SIZE);
@ -101,15 +94,14 @@ hci_command_send(unsigned short usOpcode, unsigned char *pucBuff,
//! @brief Initiate an HCI data write operation
//
//*****************************************************************************
long
hci_data_send(unsigned char ucOpcode,
unsigned char *ucArgs,
unsigned short usArgsLength,
unsigned short usDataLength,
const unsigned char *ucTail,
unsigned short usTailLength)
INT32 hci_data_send(UINT8 ucOpcode,
UINT8 *ucArgs,
UINT16 usArgsLength,
UINT16 usDataLength,
const UINT8 *ucTail,
UINT16 usTailLength)
{
unsigned char *stream;
UINT8 *stream;
stream = ((ucArgs) + SPI_HEADER_SIZE);
@ -139,10 +131,9 @@ hci_data_send(unsigned char ucOpcode,
//! @brief Prepeare HCI header and initiate an HCI data write operation
//
//*****************************************************************************
void hci_data_command_send(unsigned short usOpcode, unsigned char *pucBuff,
unsigned char ucArgsLength,unsigned short ucDataLength)
void hci_data_command_send(UINT16 usOpcode, UINT8 *pucBuff, UINT8 ucArgsLength,UINT16 ucDataLength)
{
unsigned char *stream = (pucBuff + SPI_HEADER_SIZE);
UINT8 *stream = (pucBuff + SPI_HEADER_SIZE);
UINT8_TO_STREAM(stream, HCI_TYPE_DATA);
UINT8_TO_STREAM(stream, usOpcode);
@ -169,12 +160,11 @@ void hci_data_command_send(unsigned short usOpcode, unsigned char *pucBuff,
//! @brief Prepeare HCI header and initiate an HCI patch write operation
//
//*****************************************************************************
void
hci_patch_send(unsigned char ucOpcode, unsigned char *pucBuff, char *patch, unsigned short usDataLength)
void hci_patch_send(UINT8 ucOpcode, UINT8 *pucBuff, CHAR *patch, UINT16 usDataLength)
{
unsigned char *data_ptr = (pucBuff + SPI_HEADER_SIZE);
unsigned short usTransLength;
unsigned char *stream = (pucBuff + SPI_HEADER_SIZE);
UINT8 *data_ptr = (pucBuff + SPI_HEADER_SIZE);
UINT16 usTransLength;
UINT8 *stream = (pucBuff + SPI_HEADER_SIZE);
UINT8_TO_STREAM(stream, HCI_TYPE_PATCH);
UINT8_TO_STREAM(stream, ucOpcode);
@ -216,12 +206,12 @@ hci_patch_send(unsigned char ucOpcode, unsigned char *pucBuff, char *patch, unsi
usDataLength -= usTransLength;
}
*(unsigned short *)data_ptr = usTransLength;
*(UINT16 *)data_ptr = usTransLength;
memcpy(data_ptr + SIMPLE_LINK_HCI_PATCH_HEADER_SIZE, patch, usTransLength);
patch += usTransLength;
// Update the opcode of the event we will be waiting for
SpiWrite((unsigned char *)data_ptr, usTransLength + sizeof(usTransLength));
SpiWrite((UINT8 *)data_ptr, usTransLength + sizeof(usTransLength));
}
}
}
@ -233,5 +223,3 @@ hci_patch_send(unsigned char ucOpcode, unsigned char *pucBuff, char *patch, unsi
//
//
//*****************************************************************************
#endif // MICROPY_HW_ENABLE_CC3K

View File

@ -0,0 +1,196 @@
/*
* Copyright (C) 1996-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <std.h>
#include <string.h>
#include "cc3000_common.h"
#include "socket.h"
#include "inet_ntop.h"
#define IN6ADDRSZ 16
#define INADDRSZ 4
#define INT16SZ 2
#define ENOSPC (28)
#define EAFNOSUPPORT (106)
#define SET_ERRNO(err) (errno=-err)
/*
* Format an IPv4 address, more or less like inet_ntoa().
*
* Returns `dst' (as a const)
* Note:
* - uses no statics
* - takes a unsigned char* not an in_addr as input
*/
static char *inet_ntop4 (const unsigned char *src, char *dst, size_t size)
{
size_t len;
char tmp[sizeof "255.255.255.255"];
tmp[0] = '\0';
(void)snprintf(tmp, sizeof(tmp), "%d.%d.%d.%d",
((int)((unsigned char)src[3])) & 0xff,
((int)((unsigned char)src[2])) & 0xff,
((int)((unsigned char)src[1])) & 0xff,
((int)((unsigned char)src[0])) & 0xff);
len = strlen(tmp);
if(len == 0 || len >= size)
{
SET_ERRNO(ENOSPC);
return (NULL);
}
strcpy(dst, tmp);
return dst;
}
#ifdef ENABLE_IPV6
/*
* Convert IPv6 binary address into presentation (printable) format.
*/
static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size)
{
/*
* Note that int32_t and int16_t need only be "at least" large enough
* to contain a value of the specified size. On some systems, like
* Crays, there is no such thing as an integer variable with 16 bits.
* Keep this in mind if you think this function should have been coded
* to use pointer overlays. All the world's not a VAX.
*/
char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
char *tp;
struct {
long base;
long len;
} best, cur;
unsigned long words[IN6ADDRSZ / INT16SZ];
int i;
/* Preprocess:
* Copy the input (bytewise) array into a wordwise array.
* Find the longest run of 0x00's in src[] for :: shorthanding.
*/
memset(words, '\0', sizeof(words));
for (i = 0; i < IN6ADDRSZ; i++)
words[i/2] |= (src[i] << ((1 - (i % 2)) << 3));
best.base = -1;
cur.base = -1;
best.len = 0;
cur.len = 0;
for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
{
if(words[i] == 0)
{
if(cur.base == -1)
cur.base = i, cur.len = 1;
else
cur.len++;
}
else if(cur.base != -1)
{
if(best.base == -1 || cur.len > best.len)
best = cur;
cur.base = -1;
}
}
if((cur.base != -1) && (best.base == -1 || cur.len > best.len))
best = cur;
if(best.base != -1 && best.len < 2)
best.base = -1;
/* Format the result.
*/
tp = tmp;
for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
{
/* Are we inside the best run of 0x00's?
*/
if(best.base != -1 && i >= best.base && i < (best.base + best.len))
{
if(i == best.base)
*tp++ = ':';
continue;
}
/* Are we following an initial run of 0x00s or any real hex?
*/
if(i != 0)
*tp++ = ':';
/* Is this address an encapsulated IPv4?
*/
if(i == 6 && best.base == 0 &&
(best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
{
if(!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp)))
{
SET_ERRNO(ENOSPC);
return (NULL);
}
tp += strlen(tp);
break;
}
tp += snprintf(tp, 5, "%lx", words[i]);
}
/* Was it a trailing run of 0x00's?
*/
if(best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
*tp++ = ':';
*tp++ = '\0';
/* Check for overflow, copy, and we're done.
*/
if((size_t)(tp - tmp) > size)
{
SET_ERRNO(ENOSPC);
return (NULL);
}
strcpy(dst, tmp);
return dst;
}
#endif /* ENABLE_IPV6 */
/*
* Convert a network format address to presentation format.
*
* Returns pointer to presentation format address (`buf').
* Returns NULL on error and errno set with the specific
* error, EAFNOSUPPORT or ENOSPC.
*
* On Windows we store the error in the thread errno, not
* in the winsock error code. This is to avoid loosing the
* actual last winsock error. So use macro ERRNO to fetch the
* errno this funtion sets when returning NULL, not SOCKERRNO.
*/
char *inet_ntop(int af, const void *src, char *buf, size_t size)
{
switch (af) {
case AF_INET:
return inet_ntop4((const unsigned char*)src, buf, size);
#ifdef ENABLE_IPV6
case AF_INET6:
return inet_ntop6((const unsigned char*)src, buf, size);
#endif
default:
SET_ERRNO(EAFNOSUPPORT);
return NULL;
}
}

View File

@ -0,0 +1,216 @@
/* This is from the BIND 4.9.4 release, modified to compile by itself */
/* Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#include <string.h>
#include "cc3000_common.h"
#include "socket.h"
#include "inet_pton.h"
#define IN6ADDRSZ 16
#define INADDRSZ 4
#define INT16SZ 2
static int inet_pton4(const char *src, unsigned char *dst);
#ifdef ENABLE_IPV6
static int inet_pton6(const char *src, unsigned char *dst);
#endif
#define EAFNOSUPPORT (106)
#define SET_ERRNO(err) (errno=-err)
/* int
* inet_pton(af, src, dst)
* convert from presentation format (which usually means ASCII printable)
* to network format (which is usually some kind of binary format).
* return:
* 1 if the address was valid for the specified address family
* 0 if the address wasn't valid (`dst' is untouched in this case)
* -1 if some other error occurred (`dst' is untouched in this case, too)
* notice:
* On Windows we store the error in the thread errno, not
* in the winsock error code. This is to avoid loosing the
* actual last winsock error. So use macro ERRNO to fetch the
* errno this funtion sets when returning (-1), not SOCKERRNO.
* author:
* Paul Vixie, 1996.
*/
int inet_pton(int af, const char *src, void *dst)
{
switch (af) {
case AF_INET:
return (inet_pton4(src, (unsigned char *)dst));
#ifdef ENABLE_IPV6
case AF_INET6:
return (inet_pton6(src, (unsigned char *)dst));
#endif
default:
SET_ERRNO(EAFNOSUPPORT);
return (-1);
}
/* NOTREACHED */
}
/* int
* inet_pton4(src, dst)
* like inet_aton() but without all the hexadecimal and shorthand.
* return:
* 1 if `src' is a valid dotted quad, else 0.
* notice:
* does not touch `dst' unless it's returning 1.
* author:
* Paul Vixie, 1996.
*/
static int inet_pton4(const char *src, unsigned char *dst)
{
static const char digits[] = "0123456789";
int saw_digit, octets, ch;
unsigned char tmp[INADDRSZ], *tp;
saw_digit = 0;
octets = 0;
tp = tmp;
*tp = 0;
while((ch = *src++) != '\0') {
const char *pch;
if((pch = strchr(digits, ch)) != NULL) {
unsigned int val = *tp * 10 + (unsigned int)(pch - digits);
if(saw_digit && *tp == 0)
return (0);
if(val > 255)
return (0);
*tp = (unsigned char)val;
if(! saw_digit) {
if(++octets > 4)
return (0);
saw_digit = 1;
}
}
else if(ch == '.' && saw_digit) {
if(octets == 4)
return (0);
*++tp = 0;
saw_digit = 0;
}
else
return (0);
}
if(octets < 4)
return (0);
memcpy(dst, tmp, INADDRSZ);
return (1);
}
#ifdef ENABLE_IPV6
/* int
* inet_pton6(src, dst)
* convert presentation level address to network order binary form.
* return:
* 1 if `src' is a valid [RFC1884 2.2] address, else 0.
* notice:
* (1) does not touch `dst' unless it's returning 1.
* (2) :: in a full address is silently ignored.
* credit:
* inspired by Mark Andrews.
* author:
* Paul Vixie, 1996.
*/
static int inet_pton6(const char *src, unsigned char *dst)
{
static const char xdigits_l[] = "0123456789abcdef",
xdigits_u[] = "0123456789ABCDEF";
unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
int ch, saw_xdigit;
unsigned int val;
memset((tp = tmp), 0, IN6ADDRSZ);
endp = tp + IN6ADDRSZ;
colonp = NULL;
/* Leading :: requires some special handling. */
if(*src == ':')
if(*++src != ':')
return (0);
curtok = src;
saw_xdigit = 0;
val = 0;
while((ch = *src++) != '\0') {
const char *pch;
if((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
pch = strchr((xdigits = xdigits_u), ch);
if(pch != NULL) {
val <<= 4;
val |= (pch - xdigits);
if(++saw_xdigit > 4)
return (0);
continue;
}
if(ch == ':') {
curtok = src;
if(!saw_xdigit) {
if(colonp)
return (0);
colonp = tp;
continue;
}
if(tp + INT16SZ > endp)
return (0);
*tp++ = (unsigned char) (val >> 8) & 0xff;
*tp++ = (unsigned char) val & 0xff;
saw_xdigit = 0;
val = 0;
continue;
}
if(ch == '.' && ((tp + INADDRSZ) <= endp) &&
inet_pton4(curtok, tp) > 0) {
tp += INADDRSZ;
saw_xdigit = 0;
break; /* '\0' was seen by inet_pton4(). */
}
return (0);
}
if(saw_xdigit) {
if(tp + INT16SZ > endp)
return (0);
*tp++ = (unsigned char) (val >> 8) & 0xff;
*tp++ = (unsigned char) val & 0xff;
}
if(colonp != NULL) {
/*
* Since some memmove()'s erroneously fail to handle
* overlapping regions, we'll do the shift by hand.
*/
const long n = tp - colonp;
long i;
if(tp == endp)
return (0);
for (i = 1; i <= n; i++) {
endp[- i] = colonp[n - i];
colonp[n - i] = 0;
}
tp = endp;
}
if(tp != endp)
return (0);
memcpy(dst, tmp, IN6ADDRSZ);
return (1);
}
#endif /* ENABLE_IPV6 */

View File

@ -32,18 +32,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
#include <stdint.h>
#include "mpconfigport.h"
#if MICROPY_HW_ENABLE_CC3K
#include <string.h>
#include "netapp.h"
#include "hci.h"
#include "socket.h"
#include "evnt_handler.h"
#include "nvmem.h"
#define MIN_TIMER_VAL_SECONDS 20
#define MIN_TIMER_VAL_SECONDS 10
#define MIN_TIMER_SET(t) if ((0 != t) && (t < MIN_TIMER_VAL_SECONDS)) \
{ \
t = MIN_TIMER_VAL_SECONDS; \
@ -70,7 +67,7 @@
//! over resets.
//
//*****************************************************************************
long netapp_config_mac_adrress(unsigned char * mac)
INT32 netapp_config_mac_adrress(UINT8 * mac)
{
return nvmem_set_mac_address(mac);
}
@ -101,11 +98,11 @@ long netapp_config_mac_adrress(unsigned char * mac)
//! AP was established.
//!
//*****************************************************************************
long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsigned long *aucDefaultGateway, unsigned long *aucDNSServer)
INT32 netapp_dhcp(UINT32 *aucIP, UINT32 *aucSubnetMask,UINT32 *aucDefaultGateway, UINT32 *aucDNSServer)
{
signed char scRet;
unsigned char *ptr;
unsigned char *args;
INT8 scRet;
UINT8 *ptr;
UINT8 *args;
scRet = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -137,7 +134,7 @@ long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsigned lon
//! 0 or 0xffffffff == infinity lease timeout.
//! Resolution:10 seconds. Influence: only after
//! reconnecting to the AP.
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 20 seconds.
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 10 seconds.
//! The parameter is saved into the CC3000 NVMEM.
//! The default value on CC3000 is 14400 seconds.
//!
@ -146,7 +143,7 @@ long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsigned lon
//! the end of the timeout.
//! Range: [0-0xffffffff] seconds, 0 == infinity ARP timeout
//! Resolution: 10 seconds. Influence: on runtime.
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 20 seconds
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 10 seconds
//! The parameter is saved into the CC3000 NVMEM.
//! The default value on CC3000 is 3600 seconds.
//!
@ -154,7 +151,7 @@ long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsigned lon
//! Range: [0-0xffffffff] seconds, 0 == infinity timeout
//! Resolution: 10 seconds.
//! Influence: on runtime.
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 20 sec
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 10 sec
//! The parameter is saved into the CC3000 NVMEM.
//! The default value on CC3000 is 10 seconds.
//!
@ -163,7 +160,7 @@ long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsigned lon
//! end of the socket timeout the socket will be closed
//! Range: [0-0xffffffff] sec, 0 == infinity timeout.
//! Resolution: 10 seconds. Influence: on runtime.
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 20 sec
//! Minimal bound value: MIN_TIMER_VAL_SECONDS - 10 sec
//! The parameter is saved into the CC3000 NVMEM.
//! The default value on CC3000 is 60 seconds.
//!
@ -173,18 +170,17 @@ long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,unsigned lon
//! DHCP lease timeout, ARP refresh timeout, keepalive event
//! timeout and socket inactivity timeout
//!
//! @note If a parameter set to non zero value which is less than 20s,
//! it will be set automatically to 20s.
//! @note If a parameter set to non zero value which is less than 10s,
//! it will be set automatically to 10s.
//!
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
long
netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,unsigned long *aucKeepalive, unsigned long *aucInactivity)
INT32 netapp_timeout_values(UINT32 *aucDHCP, UINT32 *aucARP,UINT32 *aucKeepalive, UINT32 *aucInactivity)
{
signed char scRet;
unsigned char *ptr;
unsigned char *args;
INT8 scRet;
UINT8 *ptr;
UINT8 *args;
scRet = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -235,11 +231,11 @@ netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,unsigned lon
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
long
netapp_ping_send(unsigned long *ip, unsigned long ulPingAttempts, unsigned long ulPingSize, unsigned long ulPingTimeout)
INT32
netapp_ping_send(UINT32 *ip, UINT32 ulPingAttempts, UINT32 ulPingSize, UINT32 ulPingTimeout)
{
signed char scRet;
unsigned char *ptr, *args;
INT8 scRet;
UINT8 *ptr, *args;
scRet = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -288,9 +284,9 @@ netapp_ping_send(unsigned long *ip, unsigned long ulPingAttempts, unsigned long
#ifndef CC3000_TINY_DRIVER
void netapp_ping_report()
{
unsigned char *ptr;
UINT8 *ptr;
ptr = tSLInformation.pucTxCommandBuffer;
signed char scRet;
INT8 scRet;
scRet = EFAIL;
@ -316,10 +312,10 @@ void netapp_ping_report()
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
long netapp_ping_stop()
INT32 netapp_ping_stop()
{
signed char scRet;
unsigned char *ptr;
INT8 scRet;
UINT8 *ptr;
scRet = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -363,7 +359,7 @@ long netapp_ping_stop()
#ifndef CC3000_TINY_DRIVER
void netapp_ipconfig( tNetappIpconfigRetArgs * ipconfig )
{
unsigned char *ptr;
UINT8 *ptr;
ptr = tSLInformation.pucTxCommandBuffer;
@ -394,10 +390,10 @@ void netapp_ipconfig( tNetappIpconfigRetArgs * ipconfig )
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
long netapp_arp_flush(void)
INT32 netapp_arp_flush(void)
{
signed char scRet;
unsigned char *ptr;
INT8 scRet;
UINT8 *ptr;
scRet = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -432,10 +428,10 @@ long netapp_arp_flush(void)
#ifndef CC3000_TINY_DRIVER
long netapp_set_debug_level(unsigned long ulLevel)
INT32 netapp_set_debug_level(UINT32 ulLevel)
{
signed char scRet;
unsigned char *ptr, *args;
INT8 scRet;
UINT8 *ptr, *args;
scRet = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -461,5 +457,3 @@ long netapp_set_debug_level(unsigned long ulLevel)
}
#endif
#endif // MICROPY_HW_ENABLE_CC3K

View File

@ -40,12 +40,7 @@
//
//*****************************************************************************
#include <stdint.h>
#include <string.h>
#include "mpconfigport.h"
#if MICROPY_HW_ENABLE_CC3K
#include "nvmem.h"
#include "hci.h"
#include "socket.h"
@ -77,7 +72,7 @@
//! @param ulOffset ulOffset in file from where to read
//! @param buff output buffer pointer
//!
//! @return number of bytes read, otherwise error.
//! @return on success 0, error otherwise.
//!
//! @brief Reads data from the file referred by the ulFileId parameter.
//! Reads data from file ulOffset till length. Err if the file can't
@ -85,12 +80,11 @@
//!
//*****************************************************************************
signed long
nvmem_read(unsigned long ulFileId, unsigned long ulLength, unsigned long ulOffset, unsigned char *buff)
INT32 nvmem_read(UINT32 ulFileId, UINT32 ulLength, UINT32 ulOffset, UINT8 *buff)
{
unsigned char ucStatus = 0xFF;
unsigned char *ptr;
unsigned char *args;
UINT8 ucStatus = 0xFF;
UINT8 *ptr;
UINT8 *args;
ptr = tSLInformation.pucTxCommandBuffer;
args = (ptr + HEADERS_SIZE_CMD);
@ -137,13 +131,11 @@ nvmem_read(unsigned long ulFileId, unsigned long ulLength, unsigned long ulOffse
//!
//*****************************************************************************
signed long
nvmem_write(unsigned long ulFileId, unsigned long ulLength, unsigned long
ulEntryOffset, unsigned char *buff)
INT32 nvmem_write(UINT32 ulFileId, UINT32 ulLength, UINT32 ulEntryOffset, UINT8 *buff)
{
long iRes;
unsigned char *ptr;
unsigned char *args;
INT32 iRes;
UINT8 *ptr;
UINT8 *args;
iRes = EFAIL;
@ -182,7 +174,7 @@ nvmem_write(unsigned long ulFileId, unsigned long ulLength, unsigned long
//!
//*****************************************************************************
unsigned char nvmem_set_mac_address(unsigned char *mac)
UINT8 nvmem_set_mac_address(UINT8 *mac)
{
return nvmem_write(NVMEM_MAC_FILEID, MAC_ADDR_LEN, 0, mac);
}
@ -200,7 +192,7 @@ unsigned char nvmem_set_mac_address(unsigned char *mac)
//!
//*****************************************************************************
unsigned char nvmem_get_mac_address(unsigned char *mac)
UINT8 nvmem_get_mac_address(UINT8 *mac)
{
return nvmem_read(NVMEM_MAC_FILEID, MAC_ADDR_LEN, 0, mac);
}
@ -223,11 +215,11 @@ unsigned char nvmem_get_mac_address(unsigned char *mac)
//!
//*****************************************************************************
unsigned char nvmem_write_patch(unsigned long ulFileId, unsigned long spLength, const unsigned char *spData)
UINT8 nvmem_write_patch(UINT32 ulFileId, UINT32 spLength, const UINT8 *spData)
{
unsigned char status = 0;
unsigned short offset = 0;
unsigned char* spDataPtr = (unsigned char*)spData;
UINT8 status = 0;
UINT16 offset = 0;
UINT8* spDataPtr = (UINT8*)spData;
while ((status == 0) && (spLength >= SP_PORTION_SIZE))
{
@ -267,11 +259,11 @@ unsigned char nvmem_write_patch(unsigned long ulFileId, unsigned long spLength,
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
unsigned char nvmem_read_sp_version(unsigned char* patchVer)
UINT8 nvmem_read_sp_version(UINT8* patchVer)
{
unsigned char *ptr;
UINT8 *ptr;
// 1st byte is the status and the rest is the SP version
unsigned char retBuf[5];
UINT8 retBuf[5];
ptr = tSLInformation.pucTxCommandBuffer;
@ -311,12 +303,11 @@ unsigned char nvmem_read_sp_version(unsigned char* patchVer)
//!
//*****************************************************************************
signed long
nvmem_create_entry(unsigned long ulFileId, unsigned long ulNewLen)
INT32 nvmem_create_entry(UINT32 ulFileId, UINT32 ulNewLen)
{
unsigned char *ptr;
unsigned char *args;
unsigned short retval;
UINT8 *ptr;
UINT8 *args;
UINT8 retval;
ptr = tSLInformation.pucTxCommandBuffer;
args = (ptr + HEADERS_SIZE_CMD);
@ -341,5 +332,3 @@ nvmem_create_entry(unsigned long ulFileId, unsigned long ulNewLen)
//! @}
//
//*****************************************************************************
#endif // MICROPY_HW_ENABLE_CC3K

117
drivers/cc3000/src/patch.c Normal file
View File

@ -0,0 +1,117 @@
/*****************************************************************************
*
* {PatchProgrammer_DR_Patch.c}
*
* Burn Patches to EEPROM
*
* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* ALL RIGHTS RESERVED
*
*****************************************************************************/
//
// Service Pack version P1.13.7.15.28 - Driver patches
// This file contains the CC3K driver and firmware patches
// From CC3000-FRAM-PATCH V:1.13.7 15-MAY-2014
unsigned short fw_length = 5700;
unsigned short drv_length = 8024;
const unsigned char wlan_drv_patch[8024] = { 0x00, 0x01, 0x00, 0x00, 0x50, 0x1F, 0x00, 0x00, 0xF0, 0x03, 0x18, 0x00, 0xE4, 0x62, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7A, 0x63, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x10, 0x64, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x20, 0x0C, 0x49, 0x08, 0x60, 0x0C, 0x48, 0x19, 0x30, 0xF7, 0x46, 0x30, 0xB5, 0x05, 0x1C, 0xAC, 0x69, 0x68, 0x68, 0x5F, 0x30, 0x09, 0xD1, 0x60, 0x6B, 0x0C, 0x38, 0x01, 0x21, 0x8E, 0x46, 0x06, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x00, 0x20, 0x60, 0x63, 0xAC, 0x69, 0x6C, 0x60, 0x04, 0x48, 0x5B, 0x30, 0x30, 0xBD, 0x40, 0x3B, 0x08, 0x00, 0x49, 0xD0, 0x01, 0x00, 0x09, 0xEA, 0x02, 0x00, 0x91, 0xE1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA6, 0x64, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3C, 0x65, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xB5, 0x85, 0xB0, 0x05, 0x1C, 0xA8, 0x88, 0x00, 0x90, 0x28, 0x89, 0x01, 0x90, 0xE9, 0x68, 0x02, 0x91, 0x28, 0x7C, 0x03, 0x90, 0x2A, 0x6A, 0x00, 0x20, 0x17, 0x56, 0x68, 0x60, 0x00, 0x29, 0x4C, 0xD0, 0x00, 0x2F, 0x4A, 0xDC ,
0xCA, 0x49, 0x0C, 0x1C, 0x08, 0x26, 0x04, 0x90, 0x21, 0x88, 0x00, 0x98, 0x81, 0x42, 0x0C, 0xD1, 0x62, 0x88, 0x01, 0x98, 0x82, 0x42, 0x08, 0xD1, 0x46, 0x20, 0x02, 0x5D, 0x03, 0x98, 0x82, 0x42, 0x03, 0xD1, 0x0E, 0x20, 0x00, 0x57, 0xB8, 0x42, 0x0A, 0xD0, 0x46, 0x20, 0x00, 0x5D, 0x11, 0x28, 0x22, 0xD1, 0x00, 0x98, 0x81, 0x42, 0x1F, 0xD1, 0x0E, 0x20, 0x00, 0x57, 0xFF, 0xFF, 0xD2, 0x65, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0xB8, 0x42, 0x1B, 0xD1, 0x04, 0x20, 0x02, 0x1C, 0x02, 0x98, 0xB9, 0x49, 0x01, 0x23, 0x9E, 0x46, 0xEC, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x00, 0x28, 0x17, 0xD0, 0x20, 0x1D, 0x02, 0x99, 0x04, 0x22, 0x01, 0x23, 0x9E, 0x46, 0xE7, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x00, 0x28, 0x0D, 0xD0, 0x46, 0x20, 0x00, 0x5D, 0x11, 0x28, 0x09, 0xD0, 0xA0, 0x6D, 0x00, 0x28, 0x06, 0xD0, 0xAC, 0x34, 0x04, 0x98, 0x01, 0x30, 0x04, 0x90, 0x01, 0x3E, 0xC1, 0xD1, 0x07, 0xE0, 0x04, 0x98, 0x00, 0x06, 0x00, 0x0E ,
0xAC, 0x21, 0x41, 0x43, 0xA6, 0x48, 0x40, 0x18, 0x68, 0x60, 0xA6, 0x48, 0xAD, 0x30, 0x05, 0xB0, 0xF0, 0xBD, 0x00, 0xB5, 0xC2, 0x68, 0x90, 0x69, 0x02, 0x21, 0x01, 0x23, 0x9E, 0x46, 0xA2, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0xA2, 0x48, 0x61, 0x30, 0x00, 0xBD, 0x01, 0x79, 0x0B, 0x29, 0x03, 0xD0, 0x89, 0x00, 0x9F, 0x4A, 0x51, 0x5A, 0x01, 0xE0, 0x01, 0x21, 0x49, 0x02, 0x41, 0x60, 0x9D, 0x48, 0x0D, 0x30, 0xF7, 0x46, 0x01, 0x1C, 0xFF, 0xFF, 0x68, 0x66, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x9C, 0x48, 0x02, 0x68, 0x9C, 0x48, 0x01, 0x2A, 0x01, 0xD1, 0x25, 0x30, 0xF7, 0x46, 0x9B, 0x4A, 0x12, 0x68, 0x4A, 0x60, 0x19, 0x30, 0xF7, 0x46, 0x00, 0x21, 0x41, 0x60, 0x99, 0x48, 0x98, 0x49, 0x08, 0x18, 0xF7, 0x46, 0x00, 0x21, 0x41, 0x60, 0x97, 0x48, 0xE7, 0x49, 0x08, 0x18, 0xF7, 0x46, 0xFF, 0xB5, 0x46, 0x69, 0x40, 0x68, 0x01, 0x90, 0x94, 0x49, 0x0A, 0x7C, 0x9A, 0x4F, 0x01, 0x2A, 0x63, 0xD0, 0x09, 0x7C, 0x03, 0x29 ,
0x60, 0xD0, 0x91, 0x4A, 0x92, 0x4B, 0x00, 0x21, 0x02, 0x91, 0x59, 0x56, 0x24, 0x23, 0x59, 0x43, 0x53, 0x18, 0x03, 0x93, 0x01, 0x28, 0x17, 0xD1, 0x8A, 0x18, 0x04, 0x23, 0x6C, 0x46, 0x8C, 0x49, 0x15, 0x79, 0x08, 0x78, 0xC0, 0x43, 0x28, 0x43, 0x20, 0x70, 0x01, 0x32, 0x01, 0x31, 0x01, 0x34, 0x01, 0x3B, 0xF5, 0xD1, 0x31, 0x1D, 0x68, 0x46, 0x04, 0x22, 0x01, 0x23, 0x9E, 0x46, 0xA9, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x00, 0x28, 0x40, 0xD0, 0x35, 0x1D, 0x82, 0x48, 0x00, 0x78, 0xFF, 0x28, 0xFF, 0xFF, 0xFE, 0x66, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x11, 0xD0, 0x00, 0x28, 0x0F, 0xD0, 0x03, 0x98, 0x01, 0x1D, 0x28, 0x1C, 0x01, 0x24, 0xA6, 0x46, 0x7E, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0x00, 0x28, 0x05, 0xD1, 0x7A, 0x48, 0xA6, 0x46, 0x7B, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x05, 0xE0, 0x28, 0x1C, 0x01, 0x21, 0x8E, 0x46, 0x78, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x01, 0x99, 0x01, 0x29, 0x01, 0xD1, 0x00, 0x28, 0x1E, 0xD1 ,
0x01, 0x99, 0x5F, 0x31, 0x01, 0xD0, 0x00, 0x28, 0x0F, 0xD1, 0xA8, 0x20, 0x81, 0x5D, 0x00, 0x29, 0x08, 0xD0, 0x49, 0x1E, 0x81, 0x55, 0x80, 0x5D, 0x00, 0x28, 0x09, 0xD1, 0x38, 0x1C, 0xFF, 0x30, 0x08, 0x30, 0x11, 0xE0, 0x03, 0x21, 0x02, 0x91, 0x00, 0xE0, 0xA8, 0x20, 0x02, 0x99, 0x81, 0x55, 0x38, 0x1C, 0xFF, 0x30, 0x16, 0x30, 0x07, 0xE0, 0x01, 0x98, 0x01, 0x28, 0x02, 0xD1, 0x38, 0x1C, 0xA3, 0x30, 0x01, 0xE0, 0x38, 0x1C, 0x9F, 0x30, 0x00, 0x90, 0xFF, 0xBD, 0x00, 0xB5, 0x02, 0x1C, 0x10, 0x6A, 0xD1, 0x69, 0x52, 0x69, 0xC3, 0x69, 0x5A, 0x60, 0xFF, 0xFF, 0x94, 0x67, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x01, 0x22, 0x96, 0x46, 0x5E, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0x5E, 0x48, 0xFF, 0x30, 0x6E, 0x30, 0x00, 0xBD, 0x10, 0xB5, 0x0A, 0x1C, 0x41, 0x69, 0x00, 0x6A, 0x93, 0x69, 0xDB, 0x69, 0x58, 0x60, 0x90, 0x69, 0x01, 0x24, 0xA6, 0x46, 0x56, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0xA6, 0x46, 0x56, 0x48, 0xFE, 0x44 ,
0x00, 0x47, 0x55, 0x48, 0xFF, 0x30, 0xB6, 0x30, 0x10, 0xBD, 0x70, 0xB5, 0x05, 0x1C, 0x6E, 0x69, 0x53, 0x48, 0x02, 0x68, 0x5C, 0x21, 0x88, 0x5D, 0x04, 0x28, 0x15, 0xD1, 0x07, 0x20, 0x88, 0x55, 0x10, 0x0B, 0x11, 0xD2, 0x01, 0x24, 0xA6, 0x46, 0x4E, 0x48, 0xFE, 0x44, 0x00, 0x47, 0x00, 0x28, 0x0A, 0xD0, 0x47, 0x21, 0x89, 0x57, 0xC1, 0x60, 0x11, 0x21, 0xC9, 0x02, 0x00, 0x22, 0x04, 0x23, 0xA6, 0x46, 0xE8, 0x4C, 0xFE, 0x44, 0x20, 0x47, 0x01, 0x20, 0x68, 0x60, 0x43, 0x48, 0xED, 0x49, 0x08, 0x18, 0x70, 0xBD, 0x70, 0xB5, 0x05, 0x1C, 0xAE, 0x69, 0x9C, 0x20, 0x80, 0x19, 0x4B, 0x21, 0x89, 0x00, 0x01, 0x24, 0xFF, 0xFF, 0x2A, 0x68, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0xA6, 0x46, 0xE8, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0x5C, 0x21, 0x88, 0x5D, 0x07, 0x28, 0x01, 0xD1, 0x09, 0x20, 0x00, 0xE0, 0x05, 0x20, 0xAA, 0x69, 0x88, 0x54, 0x30, 0x1C, 0xA6, 0x46, 0xE9, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x68, 0x60, 0xE8, 0x48 ,
0x4D, 0x30, 0x70, 0xBD, 0xF0, 0xB5, 0x41, 0x68, 0x82, 0x68, 0x88, 0x23, 0x5E, 0x18, 0x37, 0x88, 0x0B, 0x6F, 0x00, 0x2B, 0x01, 0xD1, 0x00, 0x2F, 0x10, 0xD1, 0x06, 0x2F, 0x02, 0xDD, 0x00, 0x21, 0xC9, 0x43, 0x07, 0xE0, 0x33, 0x88, 0x9B, 0x00, 0xC9, 0x18, 0x0A, 0x67, 0x31, 0x88, 0x01, 0x31, 0x31, 0x80, 0x01, 0x21, 0x81, 0x60, 0xE1, 0x48, 0x1D, 0x30, 0xF0, 0xBD, 0x0B, 0x1C, 0x01, 0x24, 0x5D, 0x6F, 0x1D, 0x67, 0x04, 0x33, 0x01, 0x34, 0x06, 0x2C, 0xE1, 0xDA, 0xF8, 0xE7, 0x00, 0xB5, 0x00, 0x21, 0xC1, 0x60, 0xE9, 0x48, 0x01, 0x68, 0x10, 0x31, 0xE6, 0x48, 0x20, 0x22, 0x01, 0x23, 0x9E, 0x46, 0xE7, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0xE5, 0x48, 0xFB, 0x30, 0x00, 0xBD, 0xFF, 0xFF, 0xC0, 0x68, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x14, 0x0D, 0x1B, 0x00, 0x54, 0x19, 0x1B, 0x00, 0x91, 0x1A, 0x01, 0x00, 0x4B, 0xAD, 0x03, 0x00, 0x61, 0x4E, 0x01, 0x00, 0x06, 0x32, 0x08, 0x00, 0x1F, 0x0B, 0x02, 0x00, 0x54, 0x3F ,
0x08, 0x00, 0x45, 0xC1, 0x00, 0x00, 0x84, 0x3C, 0x08, 0x00, 0x1B, 0x02, 0x00, 0x00, 0xED, 0x17, 0x00, 0x00, 0xF3, 0xC1, 0x01, 0x00, 0x34, 0x19, 0x1B, 0x00, 0x08, 0x19, 0x1B, 0x00, 0xA6, 0x44, 0x08, 0x00, 0x1C, 0x17, 0x1B, 0x00, 0x18, 0x17, 0x1B, 0x00, 0xCB, 0x67, 0x03, 0x00, 0x0D, 0x47, 0x02, 0x00, 0x39, 0x42, 0x03, 0x00, 0xBD, 0xE7, 0x02, 0x00, 0xB1, 0x40, 0x03, 0x00, 0xB9, 0xEA, 0x01, 0x00, 0x45, 0xDA, 0x00, 0x00, 0x24, 0x41, 0x08, 0x00, 0x71, 0xC0, 0x02, 0x00, 0xF0, 0xB5, 0x88, 0xB0, 0x06, 0x91, 0x07, 0x90, 0x86, 0x69, 0xF0, 0x1C, 0xD9, 0xA1, 0x04, 0x22, 0x01, 0x24, 0xA6, 0x46, 0x14, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x00, 0x28, 0x32, 0xD1, 0xF2, 0x79, 0xD7, 0x48, 0x02, 0x70, 0x35, 0x7A, 0x77, 0x7A, 0x78, 0x1B, 0xFF, 0xFF, 0x56, 0x69, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x43, 0x1C, 0x93, 0x42, 0x1D, 0xD0, 0x16, 0x2A, 0x0C, 0xDB, 0x00, 0x2D, 0x0A, 0xD1, 0xD6, 0x48, 0x04, 0x70, 0x0A, 0x20 ,
0x81, 0x19, 0xD0, 0x48, 0x1A, 0x1C, 0xA6, 0x46, 0xB8, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x74, 0xE0, 0xD2, 0x48, 0x04, 0x70, 0xCC, 0x48, 0x40, 0x19, 0x0A, 0x21, 0x89, 0x19, 0x7A, 0x1B, 0x52, 0x1C, 0xA6, 0x46, 0xB1, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x67, 0xE0, 0x8F, 0xC6, 0x03, 0x00, 0xC9, 0x48, 0x04, 0x70, 0xC9, 0x48, 0x04, 0x70, 0x0A, 0x20, 0x81, 0x19, 0xC2, 0x48, 0xA6, 0x46, 0xAA, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x59, 0xE0, 0xF0, 0x1C, 0x03, 0x21, 0x0A, 0x1C, 0xBC, 0xA1, 0xA6, 0x46, 0xC6, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x00, 0x28, 0x4F, 0xD1, 0xF1, 0x79, 0xBB, 0x48, 0x01, 0x70, 0xBB, 0x4D, 0xB2, 0x79, 0x2A, 0x70, 0x03, 0x20, 0x17, 0x49, 0xF4, 0x31, 0xA6, 0x46, 0xB8, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x28, 0x78, 0x00, 0x28, 0x0B, 0xD1, 0xFF, 0xE7, 0xB8, 0x49, 0x0C, 0x70, 0xB8, 0x49, 0xFF, 0xFF, 0xEC, 0x69, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x0C, 0x70, 0x03, 0x20, 0x0F, 0x49, 0xF5, 0x31, 0xA6, 0x46 ,
0xB6, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0x20, 0x1C, 0xF2, 0x79, 0x35, 0x7A, 0x77, 0x7A, 0x79, 0x1B, 0x4B, 0x1C, 0x93, 0x42, 0x20, 0xD0, 0xA9, 0x49, 0x09, 0x78, 0x16, 0x29, 0x0F, 0xDB, 0x00, 0x2D, 0x0D, 0xD1, 0xAB, 0x49, 0x08, 0x70, 0x0A, 0x20, 0x81, 0x19, 0xE9, 0x48, 0x1A, 0x1C, 0xA6, 0x46, 0x8B, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x1A, 0xE0, 0xC0, 0x46, 0xC7, 0x04, 0x00, 0x00, 0xA5, 0x49, 0x08, 0x70, 0xE3, 0x48, 0x40, 0x19, 0x0A, 0x21, 0x89, 0x19, 0x7A, 0x1B, 0x52, 0x1C, 0xA6, 0x46, 0x83, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x0A, 0xE0, 0x9E, 0x49, 0x08, 0x70, 0x9E, 0x49, 0x08, 0x70, 0x0A, 0x20, 0x81, 0x19, 0xDB, 0x48, 0xA6, 0x46, 0x7D, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x96, 0x48, 0x00, 0x78, 0x00, 0x28, 0x0A, 0xD0, 0x95, 0x48, 0x00, 0x78, 0x00, 0x28, 0x06, 0xD0, 0x94, 0x48, 0x00, 0x78, 0x00, 0x28, 0x02, 0xD0, 0x93, 0x48, 0x00, 0x78, 0x00, 0x28, 0xFF, 0xFF, 0x82, 0x6A, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00 ,
0x00, 0xD1, 0x8C, 0xE0, 0x03, 0x20, 0x17, 0x21, 0x89, 0x01, 0xA6, 0x46, 0x90, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0x87, 0x48, 0x01, 0x78, 0x87, 0x48, 0x07, 0x78, 0x84, 0x4E, 0x83, 0x4D, 0xE0, 0x48, 0x00, 0x68, 0x00, 0x28, 0x2E, 0xD1, 0x07, 0x98, 0x41, 0x61, 0x06, 0x62, 0xC6, 0x48, 0x06, 0x9A, 0x10, 0x64, 0x02, 0x2F, 0x01, 0xD0, 0x03, 0x2F, 0x01, 0xD1, 0x03, 0x22, 0x00, 0xE0, 0x3A, 0x1C, 0x06, 0x9B, 0xDA, 0x63, 0x2A, 0x78, 0x9A, 0x63, 0x01, 0x2F, 0x03, 0xD1, 0x05, 0x29, 0x04, 0xD0, 0x0D, 0x29, 0x02, 0xD0, 0xEC, 0x48, 0xDB, 0x30, 0x64, 0xE0, 0x00, 0x25, 0x00, 0x95, 0x01, 0x91, 0x02, 0x96, 0x03, 0x95, 0x04, 0x90, 0x2B, 0x1C, 0x20, 0x1C, 0x01, 0x1C, 0x8E, 0x46, 0xE6, 0x4E, 0xFE, 0x44, 0x30, 0x47, 0xE6, 0x48, 0x04, 0x60, 0x28, 0x1C, 0xA6, 0x46, 0xE5, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x4C, 0xE0, 0x0D, 0x27, 0x00, 0x20, 0x39, 0x1C, 0x05, 0xAA, 0xA6, 0x46, 0xE3, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x68, 0x46 ,
0xFF, 0xFF, 0x18, 0x6B, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x80, 0x8A, 0x40, 0x08, 0x05, 0xD2, 0x38, 0x1C, 0x50, 0x21, 0xA6, 0x46, 0xDC, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0x38, 0x1C, 0x21, 0x1C, 0x0B, 0x1C, 0x29, 0x1C, 0x00, 0x22, 0xA6, 0x46, 0xD9, 0x4F, 0xFE, 0x44, 0x38, 0x47, 0x2B, 0x78, 0x0D, 0x20, 0x31, 0x1C, 0x22, 0x1C, 0xA6, 0x46, 0xD5, 0x4E, 0xFE, 0x44, 0x30, 0x47, 0x28, 0x78, 0x01, 0x30, 0x02, 0x1C, 0x0D, 0x20, 0x57, 0x49, 0x23, 0x1C, 0xA6, 0x46, 0xD0, 0x4E, 0xFE, 0x44, 0x30, 0x47, 0x55, 0x4E, 0x28, 0x78, 0x02, 0x30, 0x02, 0x1C, 0x0D, 0x20, 0x31, 0x1C, 0x23, 0x1C, 0xA6, 0x46, 0xCA, 0x4F, 0xFE, 0x44, 0x38, 0x47, 0x30, 0x78, 0x00, 0x28, 0x0A, 0xD0, 0x28, 0x78, 0x03, 0x30, 0x02, 0x1C, 0x4C, 0x48, 0x03, 0x78, 0x0D, 0x20, 0x8F, 0x49, 0xA6, 0x46, 0xC3, 0x4D, 0xFE, 0x44, 0x28, 0x47, 0xBF, 0x48, 0x04, 0x60, 0x00, 0x20, 0xA6, 0x46, 0xBE, 0x49, 0xFE, 0x44, 0x08, 0x47, 0xB9, 0x48, 0xEC, 0x49 ,
0x08, 0x18, 0x08, 0xB0, 0xF0, 0xBD, 0xC0, 0x46, 0x7B, 0xC0, 0xFF, 0xFF, 0xAE, 0x6B, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x1C, 0xE9, 0x48, 0x02, 0x68, 0xE9, 0x48, 0x00, 0x2A, 0x04, 0xD0, 0x00, 0x22, 0x0A, 0x62, 0x8A, 0x61, 0x1D, 0x30, 0xF7, 0x46, 0xD7, 0x30, 0xF7, 0x46, 0xC0, 0x46, 0x9F, 0x03, 0x00, 0x00, 0x7D, 0xB8, 0x03, 0x00, 0x01, 0x1C, 0xE2, 0x48, 0x02, 0x68, 0xE2, 0x48, 0x00, 0x2A, 0x02, 0xD0, 0xFF, 0x30, 0xB4, 0x30, 0xF7, 0x46, 0x00, 0x22, 0xCA, 0x61, 0x8A, 0x61, 0x4F, 0x30, 0xF7, 0x46, 0xC9, 0x21, 0x01, 0x00, 0x91, 0xE1, 0x00, 0x00, 0xDB, 0x48, 0x01, 0x68, 0x8A, 0x69, 0x01, 0x20, 0xC0, 0x03, 0x10, 0x43, 0x88, 0x61, 0x00, 0x20, 0x08, 0x61, 0xD8, 0x48, 0x23, 0x30, 0xF7, 0x46, 0x89, 0x17, 0x02, 0x00, 0x70, 0xB5, 0x05, 0x1C, 0xD5, 0x4E, 0x29, 0x6A, 0xEA, 0x69, 0x30, 0x1C, 0x01, 0x24, 0xA6, 0x46, 0x0B, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x68, 0x69, 0xA6, 0x46, 0xD1, 0x49 ,
0xFE, 0x44, 0x08, 0x47, 0xA8, 0x69, 0x06, 0x30, 0xA8, 0x60, 0xCF, 0x48, 0x00, 0x68, 0x68, 0x60, 0xEE, 0x60, 0xCE, 0x48, 0xFF, 0xFF, 0x44, 0x6C, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x6D, 0x30, 0x70, 0xBD, 0x46, 0x17, 0x1B, 0x00, 0x30, 0x3F, 0x08, 0x00, 0x41, 0xEB, 0x00, 0x00, 0x09, 0xB4, 0x03, 0x00, 0x30, 0xB5, 0xEE, 0x48, 0x01, 0x6D, 0x80, 0x6C, 0x08, 0x43, 0x18, 0xD0, 0xEC, 0x49, 0x08, 0x1C, 0x07, 0x22, 0xFF, 0x23, 0x09, 0x33, 0x1B, 0x58, 0x00, 0x2B, 0x04, 0xD0, 0xFF, 0x30, 0x1D, 0x30, 0x01, 0x3A, 0xF6, 0xD1, 0x0B, 0xE0, 0x02, 0x20, 0xF0, 0x4A, 0xF1, 0x4B, 0x01, 0x24, 0xA6, 0x46, 0xF0, 0x4D, 0xFE, 0x44, 0x28, 0x47, 0xA6, 0x46, 0xEF, 0x48, 0xFE, 0x44, 0x00, 0x47, 0xEF, 0x48, 0xFF, 0x30, 0x5C, 0x30, 0x30, 0xBD, 0xC0, 0x46, 0x53, 0x53, 0x49, 0x44, 0x00, 0xC0, 0x46, 0xC0, 0x4B, 0x45, 0x59, 0x00, 0xEE, 0x62, 0x08, 0x00, 0xF0, 0x62, 0x08, 0x00, 0xEC, 0x62, 0x08, 0x00, 0xED, 0x62, 0x08, 0x00 ,
0xE7, 0x7E, 0x03, 0x00, 0xE8, 0x62, 0x08, 0x00, 0xE9, 0x62, 0x08, 0x00, 0xEA, 0x62, 0x08, 0x00, 0xEB, 0x62, 0x08, 0x00, 0xDD, 0x7E, 0x03, 0x00, 0x8F, 0xC6, 0x03, 0x00, 0xF0, 0xB5, 0xFF, 0xFF, 0xDA, 0x6C, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x87, 0xB0, 0x00, 0x91, 0x01, 0x90, 0x6B, 0x48, 0x01, 0x68, 0xCC, 0x4A, 0x14, 0x1C, 0x02, 0x94, 0x07, 0x26, 0x00, 0x25, 0x03, 0x95, 0x04, 0x94, 0x05, 0x95, 0xDF, 0x48, 0x00, 0x68, 0x08, 0x43, 0x27, 0xD0, 0xE0, 0x68, 0x03, 0x99, 0x88, 0x42, 0x0A, 0xDD, 0x03, 0x90, 0x40, 0x1C, 0x00, 0x99, 0x88, 0x60, 0xC2, 0x49, 0xFF, 0x20, 0x1D, 0x30, 0x68, 0x43, 0x0C, 0x18, 0xE0, 0x68, 0x04, 0x91, 0x02, 0x99, 0xC9, 0x68, 0x88, 0x42, 0x10, 0xDB, 0x88, 0x42, 0x10, 0xD1, 0x02, 0x98, 0x01, 0x27, 0xBE, 0x46, 0xCE, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x06, 0x90, 0x20, 0x1C, 0xBE, 0x46, 0xCB, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x06, 0x99, 0x88, 0x42, 0x01, 0xDA, 0x05, 0x95, 0x02, 0x94 ,
0x51, 0x48, 0x01, 0x68, 0xFF, 0x27, 0x09, 0x37, 0x38, 0x59, 0x00, 0x28, 0x06, 0xD0, 0xC7, 0x48, 0x00, 0x68, 0x07, 0x2E, 0x00, 0xD1, 0x2E, 0x1C, 0x08, 0x43, 0x04, 0xD0, 0xFF, 0x34, 0x1D, 0x34, 0x01, 0x35, 0x07, 0x2D, 0xC2, 0xDB, 0x07, 0x2E, 0xFF, 0xFF, 0x70, 0x6D, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x0A, 0xD1, 0xC0, 0x48, 0x00, 0x68, 0x08, 0x43, 0x06, 0xD0, 0x05, 0x9E, 0x30, 0x1C, 0x01, 0x21, 0x8E, 0x46, 0xBA, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x01, 0x98, 0x47, 0x61, 0x00, 0x21, 0x81, 0x61, 0xFF, 0x22, 0x1D, 0x32, 0x72, 0x43, 0x04, 0x99, 0x89, 0x18, 0xC1, 0x61, 0x06, 0x62, 0xB4, 0x48, 0x39, 0x30, 0x07, 0xB0, 0xF0, 0xBD, 0x10, 0xB5, 0x04, 0x1C, 0x00, 0x20, 0x01, 0x21, 0x8E, 0x46, 0xB1, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x40, 0x1E, 0x00, 0xD5, 0x00, 0x20, 0x60, 0x60, 0xE0, 0x61, 0xAE, 0x48, 0x21, 0x30, 0x10, 0xBD, 0xC0, 0x46, 0x10, 0x63, 0x08, 0x00, 0x70, 0xB5, 0x04, 0x1C, 0xE5, 0x69, 0x66, 0x69 ,
0x00, 0x20, 0x01, 0x21, 0x8E, 0x46, 0xA7, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x60, 0x60, 0xAB, 0x19, 0xA6, 0x4A, 0xA5, 0x49, 0x93, 0x42, 0x02, 0xD3, 0x9A, 0x1A, 0x82, 0x42, 0x02, 0xD9, 0x08, 0x1C, 0x99, 0x30, 0x70, 0xBD, 0x08, 0x1C, 0xAB, 0x30, 0x70, 0xBD, 0x08, 0x6B, 0x41, 0x7D, 0x02, 0x88, 0x92, 0x00, 0xFF, 0xFF, 0x06, 0x6E, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x51, 0x1A, 0x3C, 0x39, 0xFF, 0x22, 0x5F, 0x32, 0x91, 0x42, 0x03, 0xD9, 0x65, 0x21, 0x01, 0x80, 0x02, 0x21, 0x81, 0x73, 0x9B, 0x48, 0x99, 0x49, 0x08, 0x18, 0xF7, 0x46, 0xC0, 0x46, 0x30, 0x63, 0x08, 0x00, 0xF8, 0xB5, 0x40, 0x68, 0x24, 0x21, 0x41, 0x43, 0x97, 0x48, 0x45, 0x18, 0x28, 0x1D, 0x0C, 0x21, 0x49, 0x19, 0x04, 0x22, 0x01, 0x23, 0x9E, 0x46, 0x94, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x91, 0x4C, 0x00, 0x28, 0x1B, 0xD0, 0x2B, 0x1C, 0x04, 0x22, 0x6E, 0x46, 0x91, 0x49, 0x1F, 0x7B, 0x08, 0x78, 0xC0, 0x43, 0x38, 0x43, 0x30, 0x70, 0x01, 0x33 ,
0x01, 0x31, 0x01, 0x36, 0x01, 0x3A, 0xF5, 0xD1, 0x0C, 0x20, 0x41, 0x19, 0x68, 0x46, 0x04, 0x22, 0x01, 0x23, 0x9E, 0x46, 0x87, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x00, 0x28, 0x02, 0xD0, 0x20, 0x1C, 0x4A, 0x30, 0xF8, 0xBD, 0x20, 0x1C, 0xF8, 0xBD, 0xB1, 0xBD, 0x00, 0x00, 0x15, 0x95, 0x00, 0x00, 0x58, 0x3F, 0x08, 0x00, 0xF3, 0xF8, 0x00, 0x00, 0xE9, 0x09, 0x02, 0x00, 0xFF, 0xFF, 0x9C, 0x6E, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x2B, 0x09, 0x02, 0x00, 0xDD, 0x0A, 0x02, 0x00, 0xF8, 0xB5, 0x05, 0x1C, 0xAA, 0x69, 0x7D, 0x49, 0x00, 0x20, 0x08, 0x56, 0x24, 0x21, 0x41, 0x43, 0x76, 0x48, 0x43, 0x18, 0x04, 0x24, 0x6E, 0x46, 0x76, 0x49, 0x1F, 0x79, 0x08, 0x78, 0xC0, 0x43, 0x38, 0x43, 0x30, 0x70, 0x01, 0x33, 0x01, 0x31, 0x01, 0x36, 0x01, 0x3C, 0xF5, 0xD1, 0x11, 0x1D, 0x68, 0x46, 0x04, 0x22, 0x01, 0x24, 0xA6, 0x46, 0x6D, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x01, 0x1C, 0x6D, 0x48, 0x04, 0xD0, 0x6E, 0x49, 0x09, 0x78 ,
0x69, 0x60, 0x45, 0x30, 0xF8, 0xBD, 0xEC, 0x61, 0xAF, 0x30, 0xF8, 0xBD, 0x70, 0xB5, 0xC5, 0x68, 0x81, 0x68, 0x0A, 0x89, 0x6D, 0x4E, 0x00, 0x2A, 0x22, 0xD0, 0x01, 0x24, 0xC2, 0x6D, 0xA2, 0x18, 0xC2, 0x65, 0x08, 0x89, 0x0D, 0x28, 0x1B, 0xD1, 0x68, 0x6B, 0x21, 0x1C, 0xA6, 0x46, 0x63, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0x22, 0x1C, 0x28, 0x1C, 0x00, 0x21, 0xA6, 0x46, 0x60, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x2C, 0x60, 0xE9, 0x6B, 0xFF, 0xFF, 0x32, 0x6F, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x28, 0x1C, 0xA6, 0x46, 0x5E, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0x28, 0x1C, 0xA6, 0x46, 0x5C, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x30, 0x1C, 0x3D, 0x30, 0x70, 0xBD, 0x30, 0x1C, 0x23, 0x30, 0x70, 0xBD, 0xC0, 0x46, 0xB1, 0x02, 0x00, 0x00, 0x74, 0x3F, 0x08, 0x00, 0x19, 0xC6, 0x00, 0x00, 0x5C, 0x3F, 0x08, 0x00, 0x1D, 0xC2, 0x00, 0x00, 0x68, 0x44, 0x08, 0x00, 0x43, 0x12, 0x03, 0x00, 0x34, 0x63, 0x08, 0x00, 0x2F, 0x7A, 0x02, 0x00 ,
0xB4, 0x36, 0x08, 0x00, 0x8F, 0xF4, 0x01, 0x00, 0xF0, 0xB5, 0x05, 0x1C, 0xAB, 0x69, 0xEC, 0x69, 0x60, 0x68, 0x00, 0x68, 0x2A, 0x30, 0x01, 0x78, 0x0A, 0x06, 0x41, 0x78, 0x09, 0x04, 0x8A, 0x18, 0x81, 0x78, 0x09, 0x02, 0x8A, 0x18, 0xC1, 0x78, 0x8A, 0x18, 0x8E, 0x26, 0xF1, 0x5A, 0x09, 0x0A, 0x01, 0x70, 0xF0, 0x5C, 0x61, 0x68, 0x09, 0x68, 0x2B, 0x26, 0x70, 0x54, 0x8C, 0x20, 0xC0, 0x18, 0x61, 0x68, 0x0E, 0x68, 0x01, 0x88, 0x09, 0x0A, 0x2C, 0x27, 0xB9, 0x55, 0x61, 0x68, 0x09, 0x68, 0xFF, 0xFF, 0xC8, 0x6F, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x2D, 0x26, 0x00, 0x78, 0x70, 0x54, 0x60, 0x68, 0x01, 0x68, 0x32, 0x31, 0x08, 0x78, 0x00, 0x02, 0x49, 0x78, 0x08, 0x18, 0x00, 0x04, 0x00, 0x0C, 0x8C, 0x21, 0xCB, 0x58, 0x35, 0x49, 0x41, 0x40, 0x08, 0x04, 0x00, 0x0C, 0xC0, 0x18, 0x80, 0x1A, 0x01, 0x21, 0x8E, 0x46, 0x32, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x61, 0x68, 0x0A, 0x68, 0x32, 0x23, 0x01, 0x0A, 0x99, 0x54 ,
0x61, 0x68, 0x09, 0x68, 0x33, 0x22, 0x50, 0x54, 0x60, 0x68, 0x68, 0x60, 0x2C, 0x48, 0xF0, 0xBD, 0x00, 0x00, 0x1B, 0x00, 0x34, 0x04, 0x1B, 0x00, 0x02, 0x6A, 0x8B, 0x69, 0xDB, 0x69, 0x1B, 0x68, 0x83, 0x60, 0x88, 0x69, 0xC0, 0x69, 0x41, 0x68, 0x8A, 0x42, 0x00, 0xDA, 0x42, 0x60, 0x25, 0x48, 0x79, 0x30, 0xF7, 0x46, 0x24, 0x48, 0x57, 0x30, 0xF7, 0x46, 0x24, 0x48, 0x91, 0x30, 0xF7, 0x46, 0x32, 0x04, 0x00, 0x00, 0xC4, 0x07, 0x00, 0x00, 0x15, 0x09, 0x02, 0x00, 0xC5, 0x93, 0x00, 0x00, 0x0D, 0x91, 0x00, 0x00, 0x40, 0x1E, 0x80, 0x00, 0x1E, 0x4B, 0xFF, 0xFF, 0x5E, 0x70, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x19, 0x50, 0x1C, 0x49, 0x0A, 0x50, 0xF7, 0x46, 0xC0, 0x46, 0xBD, 0xB5, 0x00, 0x00, 0x95, 0x92, 0x00, 0x00, 0xFD, 0x93, 0x00, 0x00, 0x54, 0x3F, 0x08, 0x00, 0x29, 0x4F, 0x03, 0x00, 0xDF, 0xE8, 0x02, 0x00, 0x36, 0x89, 0x41, 0x00, 0x81, 0x06, 0x00, 0x00, 0xB1, 0x78, 0x00, 0x00, 0x94, 0xEC, 0x01, 0x00 ,
0x08, 0x19, 0x1B, 0x00, 0x8F, 0xC6, 0x03, 0x00, 0x1C, 0x17, 0x1B, 0x00, 0x67, 0x66, 0x03, 0x00, 0xA6, 0x44, 0x08, 0x00, 0x18, 0x17, 0x1B, 0x00, 0xA7, 0x2F, 0x02, 0x00, 0x91, 0x44, 0x03, 0x00, 0x91, 0x63, 0x03, 0x00, 0x5B, 0x44, 0x03, 0x00, 0xE7, 0x44, 0x03, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x61, 0xA2, 0x03, 0x00, 0x6A, 0x1E, 0x01, 0x00, 0x45, 0xDA, 0x00, 0x00, 0xD7, 0xE8, 0x01, 0x00, 0xE9, 0x78, 0x02, 0x00, 0x04, 0xF3, 0x1A, 0x00, 0x80, 0x7B, 0x08, 0x00, 0xFC, 0xB5, 0x04, 0x1C, 0xA5, 0x69, 0x60, 0x6A, 0x01, 0x90, 0x20, 0x69, 0x00, 0x28, 0x35, 0xD4, 0x08, 0x28, 0x33, 0xDA, 0xE1, 0x69, 0x09, 0x68, 0xFF, 0xFF, 0xF4, 0x70, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x10, 0x29, 0x2F, 0xD1, 0xAC, 0x21, 0x41, 0x43, 0x9E, 0x4A, 0x51, 0x5C, 0x49, 0x08, 0x27, 0xD3, 0x00, 0x06, 0x00, 0x16, 0xA2, 0x68, 0x69, 0x46, 0x01, 0x23, 0x9E, 0x46, 0x9A, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x06, 0x1C, 0x39, 0x30, 0x1F, 0xD0 ,
0x00, 0x2E, 0x1D, 0xD0, 0x00, 0x98, 0x07, 0x68, 0x00, 0x99, 0x0C, 0x39, 0x01, 0x98, 0x01, 0x60, 0x28, 0x1D, 0x10, 0x21, 0x79, 0x1A, 0x04, 0x22, 0x01, 0x23, 0x9E, 0x46, 0x91, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x02, 0x22, 0x2A, 0x80, 0xA8, 0x1C, 0x08, 0x21, 0x79, 0x1A, 0x01, 0x23, 0x9E, 0x46, 0x8C, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x03, 0xE0, 0x38, 0x20, 0x00, 0xE0, 0x00, 0x20, 0xC6, 0x43, 0x26, 0x60, 0x89, 0x48, 0x7C, 0x30, 0x20, 0x62, 0xFC, 0xBD, 0x30, 0xB5, 0x05, 0x1C, 0x28, 0x69, 0xA9, 0x69, 0x90, 0x29, 0x1D, 0xD1, 0x69, 0x69, 0x09, 0x78, 0x04, 0x29, 0x19, 0xD0, 0x05, 0x29, 0x17, 0xD0, 0x0A, 0x29, 0x15, 0xD0, 0x06, 0x29, 0x13, 0xD0, 0x0C, 0x29, 0x01, 0xDB, 0xFF, 0xFF, 0x8A, 0x71, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x10, 0x29, 0x0F, 0xD1, 0x01, 0x24, 0xA6, 0x46, 0x7D, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x7C, 0x48, 0x7D, 0x49, 0x00, 0x22, 0xA6, 0x46, 0x7C, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x7C, 0x48 ,
0xFF, 0x30, 0x5F, 0x30, 0x28, 0x62, 0x30, 0xBD, 0xF0, 0xB5, 0x89, 0xB0, 0x05, 0x90, 0x41, 0x69, 0x02, 0x69, 0x75, 0x48, 0x79, 0x4E, 0x82, 0x42, 0x3A, 0xD0, 0x04, 0x30, 0x82, 0x42, 0x25, 0xD0, 0x74, 0x4D, 0xAA, 0x42, 0x00, 0xD0, 0xCC, 0xE0, 0x08, 0x68, 0x06, 0x1C, 0x0C, 0x22, 0x8F, 0x1A, 0x4A, 0x68, 0x89, 0x18, 0x09, 0x1D, 0x10, 0x22, 0x01, 0x24, 0xA6, 0x46, 0x6E, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x01, 0x1C, 0x09, 0xD1, 0xAC, 0x22, 0x72, 0x43, 0xCB, 0x48, 0x80, 0x18, 0x46, 0x22, 0x12, 0x5C, 0x11, 0x2A, 0x01, 0xD1, 0x44, 0x22, 0x14, 0x54, 0x28, 0x1C, 0x3A, 0x1C, 0xA6, 0x46, 0x62, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x69, 0x48, 0xEC, 0x30, 0xAB, 0xE0, 0x08, 0x68, 0xC0, 0x00, 0x30, 0x18, 0x8A, 0x68, 0x02, 0x2A, 0x02, 0xD0, 0xFF, 0xFF, 0x20, 0x72, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0xE7, 0x20, 0x80, 0x00, 0xA2, 0xE0, 0xCA, 0x68, 0x89, 0x18, 0x09, 0x7B, 0x41, 0x60, 0x80, 0x21, 0x01, 0x60, 0x3B, 0x20 ,
0x00, 0x01, 0x99, 0xE0, 0x08, 0x68, 0x06, 0x90, 0xC0, 0x00, 0x34, 0x58, 0x10, 0x20, 0x04, 0x90, 0x01, 0x25, 0xAE, 0x46, 0x57, 0x48, 0xFE, 0x44, 0x00, 0x47, 0x07, 0x90, 0x00, 0x28, 0x00, 0xD1, 0x89, 0xE0, 0x0C, 0x21, 0x07, 0x98, 0x0F, 0x18, 0xB0, 0x49, 0xAC, 0x20, 0x06, 0x9A, 0x50, 0x43, 0x08, 0x18, 0x48, 0x22, 0x13, 0x5C, 0x5B, 0x06, 0x5B, 0x0E, 0x13, 0x54, 0x06, 0x9A, 0xD2, 0x00, 0xB6, 0x18, 0x71, 0x68, 0x00, 0x29, 0x47, 0xD1, 0x00, 0x2C, 0x01, 0xDD, 0x08, 0x2C, 0x21, 0xDB, 0x00, 0x22, 0x69, 0x46, 0x0A, 0x70, 0x01, 0x92, 0x0A, 0x81, 0x8A, 0x72, 0xCD, 0x72, 0x0D, 0x73, 0x4D, 0x73, 0x01, 0x88, 0x44, 0x48, 0x06, 0x23, 0xAE, 0x46, 0x44, 0x4C, 0xFE, 0x44, 0x20, 0x47, 0x04, 0x1C, 0x02, 0xDC, 0x00, 0x20, 0xC0, 0x43, 0x36, 0xE0, 0x34, 0x60, 0xAC, 0x20, 0x60, 0x43, 0x9A, 0x49, 0xFF, 0xFF, 0xB6, 0x72, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x09, 0x18, 0x5C, 0x22, 0x28, 0x1C, 0x50, 0x54, 0x48, 0x20 ,
0x42, 0x5C, 0x52, 0x06, 0x52, 0x0E, 0x42, 0x54, 0xAC, 0x20, 0x60, 0x43, 0x94, 0x49, 0x08, 0x18, 0x5C, 0x21, 0x09, 0x5C, 0x49, 0x1E, 0x02, 0x29, 0x16, 0xD9, 0x03, 0x39, 0x08, 0xD0, 0x00, 0x20, 0x30, 0x56, 0xAE, 0x46, 0xEA, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x80, 0x20, 0x30, 0x60, 0xDB, 0xE7, 0x08, 0x94, 0x80, 0x21, 0x31, 0x60, 0x48, 0x22, 0x13, 0x5C, 0x19, 0x43, 0x11, 0x54, 0xAE, 0x46, 0xE4, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x0A, 0xE0, 0x01, 0x20, 0xCE, 0xE7, 0x06, 0x98, 0x39, 0x1C, 0x04, 0xAA, 0xAE, 0x46, 0xE0, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x04, 0x1C, 0x08, 0x90, 0x06, 0x98, 0x38, 0x60, 0x08, 0x98, 0x78, 0x60, 0x00, 0x28, 0x15, 0xD0, 0xAC, 0x20, 0x60, 0x43, 0x7C, 0x49, 0x09, 0x18, 0x48, 0x88, 0x02, 0x04, 0x02, 0x20, 0x10, 0x43, 0xB8, 0x60, 0x48, 0x68, 0x02, 0x0E, 0x01, 0x02, 0x09, 0x0E, 0x09, 0x02, 0x11, 0x43, 0x02, 0x04, 0x12, 0x0E, 0xFF, 0xFF, 0x4C, 0x73, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00 ,
0x12, 0x04, 0x0A, 0x43, 0x00, 0x06, 0x10, 0x43, 0xF8, 0x60, 0x07, 0x98, 0x0D, 0x49, 0x00, 0x22, 0x10, 0x23, 0xAE, 0x46, 0xCE, 0x4C, 0xFE, 0x44, 0x20, 0x47, 0x13, 0x48, 0x00, 0xE0, 0x16, 0x20, 0xCC, 0x49, 0x09, 0x18, 0x05, 0x98, 0x01, 0x62, 0x09, 0xB0, 0xF0, 0xBD, 0x5D, 0x0D, 0x1B, 0x00, 0x81, 0xE7, 0x02, 0x00, 0x09, 0xB4, 0x03, 0x00, 0x27, 0x1A, 0x02, 0x00, 0x2F, 0x7A, 0x02, 0x00, 0x02, 0x02, 0x00, 0x00, 0x05, 0x10, 0x00, 0x00, 0xCF, 0xF6, 0x00, 0x00, 0xD5, 0xF4, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x91, 0x19, 0x02, 0x00, 0x50, 0x65, 0x08, 0x00, 0x71, 0xC0, 0x02, 0x00, 0x50, 0x19, 0x1B, 0x00, 0x29, 0x16, 0x01, 0x00, 0x2A, 0x03, 0x00, 0x00, 0xF0, 0xB5, 0x8B, 0xB0, 0x07, 0x90, 0x05, 0x69, 0x47, 0x69, 0x0C, 0x20, 0x38, 0x1A, 0x08, 0x90, 0xB6, 0x49, 0x8D, 0x42, 0x16, 0xD1, 0x78, 0x68, 0x0F, 0x30, 0x00, 0x11, 0x00, 0x01, 0x78, 0x60, 0x38, 0x68, 0x0B, 0x28, 0x0E, 0xD8, 0x00, 0x23, 0x68, 0x46 ,
0xFF, 0xFF, 0xE2, 0x73, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x03, 0x70, 0x08, 0x98, 0x05, 0x22, 0x01, 0x24, 0xA6, 0x46, 0xAE, 0x4C, 0xFE, 0x44, 0x20, 0x47, 0xAE, 0x48, 0xFF, 0x30, 0x95, 0x30, 0x07, 0x99, 0x08, 0x62, 0xAC, 0x48, 0x85, 0x42, 0x23, 0xD1, 0xAC, 0x48, 0x02, 0x78, 0x6C, 0x46, 0x22, 0x72, 0x43, 0x78, 0x63, 0x72, 0x81, 0x78, 0xA1, 0x72, 0xC0, 0x78, 0xE0, 0x72, 0x00, 0x91, 0x01, 0x90, 0x03, 0x20, 0xA6, 0x49, 0x01, 0x39, 0x01, 0x26, 0xB6, 0x46, 0xF3, 0x4E, 0xFE, 0x44, 0x30, 0x47, 0x04, 0x20, 0x20, 0x70, 0x08, 0x98, 0x9F, 0x49, 0x00, 0x22, 0x02, 0xAB, 0x01, 0x24, 0xA6, 0x46, 0x9B, 0x4C, 0xFE, 0x44, 0x20, 0x47, 0x9A, 0x48, 0xFF, 0x30, 0x95, 0x30, 0x07, 0x99, 0x08, 0x62, 0xEB, 0x49, 0x8D, 0x42, 0x14, 0xD1, 0x02, 0x22, 0x68, 0x46, 0x02, 0x70, 0x3A, 0x68, 0xAC, 0x20, 0x42, 0x43, 0x30, 0x48, 0x68, 0x30, 0x83, 0x18, 0x08, 0x98, 0x00, 0x22, 0x01, 0x24, 0xA6, 0x46, 0x8F, 0x4C, 0xFE, 0x44 ,
0x20, 0x47, 0x8E, 0x48, 0xFF, 0x30, 0x95, 0x30, 0x07, 0x99, 0xFF, 0xFF, 0x78, 0x74, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x08, 0x62, 0xEF, 0x48, 0x85, 0x42, 0x00, 0xD0, 0x04, 0xE1, 0x03, 0x20, 0x8C, 0x49, 0x01, 0x22, 0x96, 0x46, 0xEC, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0x86, 0x48, 0xFF, 0x30, 0x95, 0x30, 0x09, 0x90, 0x38, 0x68, 0xEA, 0x4D, 0x00, 0x28, 0x00, 0xD1, 0xE2, 0xE0, 0x01, 0x24, 0xA6, 0x46, 0xE6, 0x48, 0xFE, 0x44, 0x00, 0x47, 0x00, 0x28, 0x00, 0xD1, 0xD6, 0xE0, 0xE4, 0x48, 0x02, 0x68, 0x03, 0x20, 0x7F, 0x49, 0x01, 0x31, 0xA6, 0x46, 0xE2, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0xDF, 0x48, 0x00, 0x68, 0x00, 0x28, 0x5A, 0xD1, 0xDF, 0x4D, 0x2E, 0x20, 0x41, 0x19, 0xB8, 0x68, 0x03, 0x30, 0x08, 0x70, 0x38, 0x7A, 0x48, 0x70, 0x2E, 0x1C, 0x30, 0x36, 0xB8, 0x68, 0x28, 0x18, 0x30, 0x30, 0xDA, 0x49, 0x0A, 0x68, 0x30, 0x3A, 0x31, 0x1C, 0xA6, 0x46, 0xD8, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x78, 0x68, 0x38, 0x18 ,
0x01, 0x1D, 0xBA, 0x68, 0x30, 0x1C, 0xA6, 0x46, 0xD9, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0xB8, 0x68, 0x41, 0x19, 0x97, 0x22, 0xFF, 0xFF, 0x0E, 0x75, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x09, 0x30, 0x50, 0x54, 0xB8, 0x68, 0x46, 0x19, 0x9E, 0x36, 0x30, 0x70, 0x01, 0x36, 0xB8, 0x68, 0x01, 0xE0, 0x14, 0x0D, 0x1B, 0x00, 0x30, 0x18, 0xCA, 0x49, 0x0A, 0x68, 0x9E, 0x3A, 0x31, 0x1C, 0xA6, 0x46, 0xC8, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x78, 0x68, 0x38, 0x18, 0x01, 0x1D, 0xBA, 0x68, 0x30, 0x1C, 0xA6, 0x46, 0xC9, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0xB8, 0x68, 0x40, 0x00, 0xC0, 0x49, 0x09, 0x68, 0x08, 0x18, 0x28, 0x18, 0xC0, 0x49, 0x0A, 0x79, 0x02, 0x70, 0x4A, 0x79, 0x42, 0x70, 0x8A, 0x79, 0x82, 0x70, 0xC9, 0x79, 0xC1, 0x70, 0x04, 0x30, 0x0F, 0x21, 0x41, 0x1A, 0x0A, 0x78, 0xBB, 0x68, 0x9A, 0x18, 0x0A, 0x70, 0x40, 0x1B, 0x00, 0x04, 0x00, 0x0C, 0xB5, 0x49, 0x08, 0x60, 0xB1, 0x48, 0x04, 0x60, 0x02, 0x20, 0x01, 0x1C ,
0x11, 0x22, 0xA6, 0x46, 0xB4, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x06, 0x1C, 0x63, 0xD4, 0x03, 0x20, 0xA6, 0x46, 0xB1, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x0A, 0x90, 0x00, 0x25, 0x01, 0x1C, 0xFF, 0xFF, 0xA4, 0x75, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x8D, 0x42, 0x50, 0xD0, 0x29, 0x1C, 0x2B, 0x22, 0xA6, 0x46, 0xAD, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x0C, 0x20, 0x0A, 0x99, 0x40, 0x18, 0xAC, 0x22, 0x72, 0x43, 0xAB, 0x49, 0x8F, 0x18, 0x78, 0x63, 0x29, 0x1C, 0x18, 0x22, 0xA6, 0x46, 0xA6, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x9F, 0x48, 0x02, 0x68, 0x79, 0x6B, 0x4A, 0x60, 0x0A, 0x98, 0xAC, 0x30, 0x08, 0x60, 0x08, 0x68, 0x9A, 0x49, 0xA6, 0x46, 0xA0, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x29, 0x1C, 0x03, 0xA8, 0x10, 0x22, 0xA6, 0x46, 0x9C, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0xE0, 0x21, 0x68, 0x46, 0x01, 0x74, 0x45, 0x74, 0x85, 0x74, 0xFB, 0x21, 0xC1, 0x74, 0xEE, 0x49, 0xC1, 0x81, 0x02, 0x21, 0x81, 0x81, 0x79, 0x6B, 0xCA, 0x68 ,
0x01, 0x20, 0xC0, 0x03, 0x10, 0x43, 0xC8, 0x60, 0x48, 0x68, 0x00, 0x90, 0x2A, 0x1C, 0x30, 0x1C, 0x0A, 0x9D, 0x29, 0x1C, 0x03, 0xAB, 0xA6, 0x46, 0xE6, 0x4F, 0xFE, 0x44, 0x38, 0x47, 0x07, 0x1C, 0x30, 0x06, 0x00, 0x16, 0xA6, 0x46, 0xEF, 0x49, 0xFF, 0xFF, 0x3A, 0x76, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0xFE, 0x44, 0x08, 0x47, 0x28, 0x1C, 0xA6, 0x46, 0xEE, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x11, 0xE0, 0x30, 0x06, 0x00, 0x16, 0xA6, 0x46, 0xE9, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x01, 0x20, 0xC7, 0x43, 0x08, 0xE0, 0x07, 0x1C, 0x06, 0xE0, 0x00, 0x20, 0x00, 0x21, 0xCF, 0x43, 0x01, 0xE0, 0x00, 0x20, 0x07, 0x1C, 0x28, 0x60, 0x00, 0x23, 0x68, 0x46, 0x03, 0x70, 0x3A, 0x06, 0x12, 0x0E, 0x08, 0x98, 0x6F, 0x49, 0x01, 0x24, 0xA6, 0x46, 0x09, 0x4C, 0xFE, 0x44, 0x20, 0x47, 0x07, 0x98, 0x09, 0x99, 0x01, 0x62, 0x0B, 0xB0, 0xF0, 0xBD, 0xC1, 0x18, 0x01, 0x00, 0xF1, 0x1B, 0x01, 0x00, 0xF3, 0x1C, 0x02, 0x00, 0x7B, 0xC0 ,
0x02, 0x00, 0x91, 0xF0, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0xA3, 0xC0, 0x02, 0x00, 0xA9, 0xE9, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0xE4, 0x62, 0x08, 0x00, 0xAC, 0x05, 0x00, 0x00, 0xFE, 0xB5, 0x07, 0x1C, 0x7D, 0x69, 0xBE, 0x69, 0x0C, 0x20, 0x30, 0x1A, 0x01, 0x90, 0xDF, 0x4C, 0x0A, 0x2D, 0x13, 0xD1, 0xFF, 0xFF, 0xD0, 0x76, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x30, 0x68, 0xDB, 0x49, 0x08, 0x60, 0x01, 0x20, 0x86, 0x46, 0xDA, 0x48, 0xFE, 0x44, 0x00, 0x47, 0x0A, 0x20, 0x00, 0x21, 0x01, 0x9A, 0x01, 0x23, 0x9E, 0x46, 0xE6, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0xF5, 0x20, 0x80, 0x00, 0x00, 0x19, 0x38, 0x62, 0x03, 0x2D, 0x79, 0xD1, 0xF5, 0x20, 0x80, 0x00, 0x00, 0x19, 0x02, 0x90, 0x70, 0x68, 0x00, 0x28, 0x0C, 0xD1, 0x00, 0x21, 0xCF, 0x48, 0x01, 0x60, 0xCF, 0x48, 0x00, 0x68, 0x00, 0x28, 0x61, 0xD0, 0x01, 0x21, 0x8E, 0x46, 0xCD, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x5B, 0xE0, 0xCC, 0x48, 0xB1, 0x68, 0x01, 0x60 ,
0xF1, 0x68, 0x41, 0x60, 0x31, 0x69, 0x81, 0x60, 0x71, 0x69, 0xC1, 0x60, 0xB1, 0x69, 0xC1, 0x63, 0xF1, 0x69, 0x01, 0x64, 0x31, 0x6A, 0xC1, 0x64, 0x01, 0x24, 0xA6, 0x46, 0xC5, 0x48, 0xFE, 0x44, 0x00, 0x47, 0xA6, 0x46, 0xC4, 0x48, 0xFE, 0x44, 0x00, 0x47, 0x70, 0x68, 0x7D, 0x25, 0xED, 0x00, 0xA8, 0x42, 0x21, 0xD8, 0x01, 0x28, 0x18, 0xD0, 0x02, 0x28, 0x05, 0xD0, 0xFF, 0xFF, 0x66, 0x77, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x28, 0x1C, 0xA6, 0x46, 0xBE, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x1C, 0xE0, 0xB9, 0x48, 0x00, 0x23, 0x19, 0x1C, 0x59, 0x43, 0x3E, 0x22, 0x4A, 0x43, 0x82, 0x83, 0x02, 0x30, 0x01, 0x33, 0x10, 0x2B, 0xF6, 0xDB, 0xA6, 0x46, 0xB4, 0x48, 0xFE, 0x44, 0x00, 0x47, 0xB5, 0x48, 0x0D, 0xE0, 0xB5, 0x4D, 0x28, 0x1C, 0xA6, 0x46, 0xB2, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x04, 0xE0, 0xA6, 0x46, 0xAF, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x75, 0x68, 0xAE, 0x48, 0x05, 0x60, 0x05, 0x1C, 0xA7, 0x4E, 0x30, 0x68 ,
0x00, 0x28, 0x06, 0xD1, 0xAD, 0x48, 0x00, 0x68, 0xA6, 0x46, 0xAC, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x30, 0x60, 0x00, 0x94, 0x2B, 0x68, 0xAA, 0x49, 0xAB, 0x4A, 0xA6, 0x46, 0xAB, 0x4D, 0xFE, 0x44, 0x28, 0x47, 0x9C, 0x48, 0x04, 0x60, 0x03, 0x20, 0x00, 0x21, 0x01, 0x9A, 0x01, 0x23, 0x9E, 0x46, 0xA7, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x02, 0x98, 0x38, 0x62, 0xFE, 0xBD, 0xC0, 0x46, 0x13, 0x7F, 0x03, 0x00, 0x12, 0x10, 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x77, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x30, 0xB5, 0x05, 0x1C, 0x00, 0x20, 0x01, 0x24, 0xA6, 0x46, 0xA0, 0x49, 0xFE, 0x44, 0x08, 0x47, 0xA6, 0x46, 0x9F, 0x49, 0xFE, 0x44, 0x08, 0x47, 0xA6, 0x46, 0x9E, 0x48, 0xFE, 0x44, 0x00, 0x47, 0x7D, 0x21, 0xC9, 0x00, 0xA6, 0x46, 0x9E, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0x9B, 0x49, 0x08, 0x18, 0x99, 0x49, 0x08, 0x80, 0x9B, 0x48, 0x0A, 0x30, 0x28, 0x62, 0x30, 0xBD, 0x11, 0x10, 0x00, 0x00, 0xDD, 0x7E, 0x03, 0x00, 0xB9, 0x90 ,
0x00, 0x00, 0x6C, 0x64, 0x08, 0x00, 0xE7, 0x7E, 0x03, 0x00, 0x74, 0x64, 0x08, 0x00, 0x70, 0x64, 0x08, 0x00, 0x6D, 0xC6, 0x03, 0x00, 0x08, 0x19, 0x1B, 0x00, 0x11, 0x18, 0x02, 0x00, 0xD1, 0x78, 0x02, 0x00, 0xC9, 0xBA, 0x03, 0x00, 0x09, 0xB4, 0x03, 0x00, 0x14, 0x0D, 0x1B, 0x00, 0xFE, 0xB5, 0x02, 0x90, 0x45, 0x69, 0x68, 0x46, 0x01, 0x21, 0x8E, 0x46, 0x89, 0x49, 0xFE, 0x44, 0x08, 0x47, 0x89, 0x48, 0x04, 0x1C, 0x68, 0x68, 0x01, 0x69, 0x4A, 0x78, 0x00, 0x27, 0x3E, 0x1C, 0x20, 0x88, 0xFF, 0xFF, 0x92, 0x78, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x40, 0x08, 0x22, 0xD3, 0x20, 0x1D, 0x89, 0x1C, 0x01, 0x23, 0x9E, 0x46, 0x83, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x00, 0x28, 0x07, 0xD1, 0x68, 0x68, 0x00, 0x69, 0x40, 0x78, 0x21, 0x88, 0x09, 0x04, 0x89, 0x16, 0x81, 0x42, 0x3D, 0xD0, 0x02, 0x20, 0x00, 0x5F, 0x00, 0x99, 0x08, 0x1A, 0x00, 0x04, 0x00, 0x14, 0x3C, 0x28, 0x03, 0xDD, 0x20, 0x88, 0x40, 0x10, 0x40, 0x00 ,
0x20, 0x80, 0x78, 0x1C, 0x07, 0x06, 0x3F, 0x0E, 0x68, 0x68, 0x01, 0x69, 0x4A, 0x78, 0x2A, 0x34, 0x01, 0x36, 0x14, 0x2E, 0xD5, 0xDB, 0x00, 0x2A, 0x02, 0xD1, 0xAB, 0x20, 0x40, 0x00, 0x50, 0xE0, 0x00, 0x9B, 0x6D, 0x48, 0x14, 0x21, 0x00, 0x22, 0x04, 0x88, 0x64, 0x08, 0x03, 0xD3, 0x2A, 0x30, 0x01, 0x32, 0x01, 0x39, 0xF8, 0xD1, 0x12, 0x06, 0x12, 0x0E, 0x14, 0x2F, 0x16, 0xD1, 0x66, 0x48, 0x00, 0x88, 0x00, 0x06, 0x44, 0x16, 0x64, 0x49, 0x00, 0x22, 0x01, 0x20, 0x4E, 0x8D, 0x36, 0x06, 0x76, 0x16, 0xA6, 0x42, 0x02, 0xDD, 0x34, 0x1C, 0x02, 0x06, 0xFF, 0xFF, 0x28, 0x79, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0x12, 0x0E, 0x2A, 0x31, 0x01, 0x30, 0x14, 0x28, 0xF3, 0xDB, 0x02, 0xE0, 0x32, 0x06, 0x12, 0x0E, 0x00, 0x9B, 0x2A, 0x20, 0x42, 0x43, 0x5A, 0x48, 0x11, 0x18, 0x0C, 0x88, 0x01, 0x20, 0x20, 0x43, 0x00, 0x04, 0x00, 0x0C, 0x08, 0x80, 0xFE, 0x24, 0xA0, 0x43, 0x14, 0x24, 0x64, 0x57, 0x64, 0x06, 0x24, 0x0E ,
0x04, 0x43, 0x52, 0x48, 0x14, 0x52, 0x14, 0x18, 0x63, 0x80, 0x08, 0x88, 0x80, 0x05, 0x82, 0x0D, 0x68, 0x68, 0x00, 0x69, 0x40, 0x78, 0x80, 0x02, 0x10, 0x43, 0x08, 0x80, 0x68, 0x68, 0x02, 0x69, 0x20, 0x1D, 0x91, 0x1C, 0x52, 0x78, 0x01, 0x23, 0x9E, 0x46, 0x4B, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x02, 0x98, 0x04, 0x61, 0xFE, 0x20, 0x47, 0x49, 0x09, 0x18, 0x02, 0x98, 0x01, 0x62, 0xFE, 0xBD, 0x82, 0x69, 0x41, 0x69, 0x03, 0x69, 0x02, 0x2B, 0x0A, 0xD1, 0x01, 0x2A, 0x01, 0xD1, 0x00, 0x29, 0x05, 0xD0, 0x02, 0x2A, 0x04, 0xD1, 0x00, 0x29, 0x02, 0xD1, 0x11, 0x21, 0x00, 0xE0, 0x06, 0x21, 0x41, 0x61, 0xF7, 0x46, 0xFF, 0xFF, 0xBE, 0x79, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0xC0, 0x46, 0x14, 0xE9, 0x00, 0x00, 0xC9, 0x18, 0x02, 0x00, 0x30, 0xB5, 0x05, 0x1C, 0x3A, 0x48, 0x00, 0x78, 0x00, 0x28, 0x04, 0xD0, 0x01, 0x20, 0x86, 0x46, 0x38, 0x48, 0xFE, 0x44, 0x00, 0x47, 0x01, 0x24, 0xA6, 0x46, 0x37, 0x48, 0xFE, 0x44 ,
0x00, 0x47, 0xA6, 0x46, 0x36, 0x48, 0xFE, 0x44, 0x00, 0x47, 0x35, 0x48, 0x0E, 0x30, 0x28, 0x62, 0x30, 0xBD, 0x49, 0x19, 0x01, 0x00, 0x2F, 0x7A, 0x02, 0x00, 0x18, 0xB5, 0x43, 0x69, 0x81, 0x69, 0x31, 0x48, 0x81, 0x29, 0x00, 0xD1, 0x0B, 0x38, 0x00, 0x21, 0x00, 0x91, 0x1A, 0x68, 0x9B, 0x68, 0x01, 0x24, 0xA6, 0x46, 0x2D, 0x4C, 0xFE, 0x44, 0x20, 0x47, 0x18, 0xBD, 0x18, 0xB5, 0x40, 0x69, 0x00, 0x21, 0x00, 0x91, 0x02, 0x68, 0x83, 0x68, 0x27, 0x48, 0x01, 0x30, 0x01, 0x24, 0xA6, 0x46, 0x26, 0x4C, 0xFE, 0x44, 0x20, 0x47, 0x18, 0xBD, 0xC0, 0x46, 0x30, 0x63, 0x08, 0x00, 0x19, 0x9E, 0x00, 0x00, 0xB9, 0xEC, 0x00, 0x00, 0x74, 0x3F, 0x08, 0x00, 0x80, 0x3F, 0x08, 0x00, 0xFF, 0xFF, 0x54, 0x7A, 0x08, 0x00, 0x96, 0x00, 0x00, 0x00, 0xB7, 0x5D, 0x03, 0x00, 0x00, 0x00, 0x1B, 0x00, 0xD3, 0x8E, 0x00, 0x00, 0xF7, 0xC6, 0x00, 0x00, 0xE5, 0x90, 0x00, 0x00, 0x68, 0x64, 0x08, 0x00, 0xC0, 0x27, 0x09, 0x00, 0xA0, 0x3B ,
0x08, 0x00, 0x3D, 0x5D, 0x03, 0x00, 0x19, 0xC6, 0x00, 0x00, 0xE8, 0x3A, 0x08, 0x00, 0x81, 0x5D, 0x03, 0x00, 0xCF, 0xF6, 0x00, 0x00, 0x4B, 0x4F, 0x03, 0x00, 0x6B, 0xC0, 0x03, 0x00, 0x95, 0x1E, 0x01, 0x00, 0xDA, 0x40, 0x08, 0x00, 0xDC, 0x05, 0x00, 0x00, 0x55, 0xAA, 0x03, 0x00, 0x0D, 0x91, 0x00, 0x00, 0xD7, 0x56, 0x03, 0x00, 0x08, 0x51, 0x08, 0x00, 0x8F, 0xC6, 0x03, 0x00, 0x65, 0xB8, 0x00, 0x00, 0x09, 0xB4, 0x03, 0x00, 0x84, 0x17, 0x1B, 0x00, 0xB5, 0x86, 0x01, 0x00, 0x3D, 0x47, 0x02, 0x00, 0x73, 0x49, 0x02, 0x00, 0x5F, 0x90, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0xF7, 0xF6, 0x00, 0x00, 0xFF, 0xB5, 0x68, 0x46, 0xFF, 0xF7, 0x76, 0xFF, 0xFF, 0xBD, 0xFF, 0xB5, 0x68, 0x46, 0xFF, 0xF7, 0x5A, 0xFF, 0xFF, 0xBD, 0xFF, 0xB5, 0xFF, 0xFF, 0xEA, 0x7A, 0x08, 0x00, 0x58, 0x00, 0x00, 0x00, 0x68, 0x46, 0xFF, 0xF7, 0x99, 0xFF, 0xFF, 0xBD, 0xFF, 0xB5, 0x68, 0x46, 0xFF, 0xF7, 0x83, 0xFF, 0xFF, 0xBD, 0xFF, 0xB5 ,
0x68, 0x46, 0xFF, 0xF7, 0xB6, 0xFE, 0xFF, 0xBD, 0xFF, 0xB5, 0x68, 0x46, 0xFF, 0xF7, 0x55, 0xFC, 0xFF, 0xBD, 0xFF, 0xB5, 0x68, 0x46, 0xFF, 0xF7, 0x27, 0xFB, 0xFF, 0xBD, 0xFF, 0xB5, 0x68, 0x46, 0xFF, 0xF7, 0xDD, 0xFA, 0xFF, 0xBD, 0xFF, 0xB5, 0x68, 0x46, 0xFF, 0xF7, 0x68, 0xFE, 0xFF, 0xBD, 0xFF, 0xB5, 0x68, 0x46, 0xFF, 0xF7, 0x3D, 0xFB, 0xFF, 0xBD, 0xFF, 0xB5, 0x68, 0x46, 0xFF, 0xF7, 0xBE, 0xFD, 0xFF, 0xBD, 0x78, 0x7B, 0x08, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xF8, 0xF0, 0x43, 0xFA, 0x00, 0xBD, 0x35, 0x66, 0x08, 0x00, 0x67, 0x66, 0x08, 0x00, 0x71, 0x65, 0x08, 0x00, 0x4D, 0x66, 0x08, 0x00, 0x25, 0x64, 0x08, 0x00, 0x81, 0x66, 0x08, 0x00, 0x8D, 0x66, 0x08, 0x00, 0x99, 0x66, 0x08, 0x00, 0x87, 0x67, 0x08, 0x00, 0xA7, 0x67, 0x08, 0x00, 0xD1, 0x67, 0x08, 0x00, 0x1B, 0x68, 0x08, 0x00, 0x57, 0x68, 0x08, 0x00, 0x2D, 0x69, 0x08, 0x00, 0xB1, 0x6B, 0x08, 0x00, 0xD5, 0x6B, 0x08, 0x00, 0xF9, 0x6B ,
0x08, 0x00, 0x15, 0x6C, 0x08, 0x00, 0xA1, 0x68, 0x08, 0x00, 0x59, 0x6C, 0x08, 0x00, 0xA7, 0x6D, 0x08, 0x00, 0xFF, 0x6D, 0x08, 0x00, 0x29, 0x6E, 0x08, 0x00, 0xF9, 0x6E, 0x08, 0x00, 0xD9, 0x6C, 0x08, 0x00, 0xA5, 0x6E, 0x08, 0x00, 0xCD, 0x6D, 0x08, 0x00, 0x81, 0x6F, 0x08, 0x00, 0x1D, 0x70, 0x08, 0x00, 0x31, 0x64, 0x08, 0x00, 0x39, 0x70, 0x08, 0x00, 0x3F, 0x70, 0x08, 0x00, 0x04, 0xF3, 0x1A, 0x00, 0x80, 0x00, 0x00, 0x00, 0xB2, 0x4E, 0x01, 0x00, 0x5A, 0xC1, 0x00, 0x00, 0x96, 0x1A, 0x01, 0x00, 0x22, 0x0B, 0x02, 0x00, 0x60, 0xD0, 0x01, 0x00, 0x06, 0x1A, 0x00, 0x00, 0xB8, 0xC6, 0x01, 0x00, 0xD8, 0x42, 0x03, 0x00, 0x16, 0x42, 0x03, 0x00, 0xEE, 0xDB, 0x00, 0x00, 0x62, 0xDC, 0x00, 0x00, 0xC8, 0xE1, 0x00, 0x00, 0x8A, 0x17, 0x02, 0x00, 0x38, 0xBE, 0x00, 0x00, 0x26, 0xC6, 0x00, 0x00, 0x56, 0xC2, 0x00, 0x00, 0x62, 0x12, 0x03, 0x00, 0xE4, 0xF4, 0x01, 0x00, 0x3A, 0xEC, 0x00, 0x00, 0x5E, 0x92, 0x00, 0x00 ,
0xFE, 0xE8, 0x02, 0x00, 0x18, 0x7F, 0x00, 0x00, 0x64, 0xEC, 0x01, 0x00, 0xFE, 0x44, 0x03, 0x00, 0x1C, 0x94, 0x00, 0x00, 0xA8, 0x66, 0x03, 0x00, 0x74, 0xE9, 0x02, 0x00, 0x68, 0x1E, 0x01, 0x00, 0xBC, 0xDA, 0x00, 0x00, 0xEA, 0xE1, 0x00, 0x00, 0x24, 0xE9, 0x01, 0x00, 0x70, 0x79, 0x02, 0x00, 0x00, 0x00, 0x18, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x06, 0x01, 0x1C, 0xF0, 0xB5, 0x88, 0xB0, 0xCA, 0x4C, 0x03, 0x20, 0x22, 0x78, 0x63, 0x78, 0xCA, 0x4E, 0x31, 0x1C, 0x01, 0x39, 0x01, 0x25, 0xAE, 0x46, 0xC7, 0x4F, 0xFE, 0x44, 0x38, 0x47, 0xA2, 0x78, 0xE3, 0x78, 0x03, 0x20, 0x31, 0x1C, 0xAE, 0x46, 0xC3, 0x4F, 0xFE, 0x44, 0x38, 0x47, 0x03, 0x20, 0x31, 0x1C, 0x01, 0x31, 0xAE, 0x46, 0xC1, 0x4A, 0xFE, 0x44, 0x10, 0x47, 0xC1, 0x48, 0x21, 0x78, 0x01, 0x70, 0x61, 0x78, 0x41, 0x70, 0xE1, 0x78, 0xC1, 0x70, 0xA1, 0x78, 0x81, 0x70, 0xBF, 0x48, 0x04, 0x1C, 0x33, 0x3C, 0x20, 0x1C, 0x00, 0x21, 0xDC, 0x22, 0xAE, 0x46 ,
0xBA, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x84, 0x20, 0xA0, 0x70, 0x05, 0x27, 0xE7, 0x71, 0x0C, 0x26, 0x26, 0x73, 0x0D, 0x20, 0x00, 0x19, 0x98, 0xA1, 0x32, 0x1C, 0xAE, 0x46, 0xB4, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x04, 0x20, 0x60, 0x76, 0x1A, 0x20, 0x00, 0x19, 0x97, 0xA1, 0x06, 0x91, 0x04, 0x22, 0xAE, 0x46, 0xAE, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0xFF, 0xFF, 0x96, 0x00, 0x18, 0x00, 0x96, 0x00, 0x00, 0x00, 0xA7, 0x77, 0x1F, 0x34, 0x95, 0xA1, 0x07, 0x91, 0x20, 0x1C, 0x3A, 0x1C, 0xAE, 0x46, 0xA9, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0xE6, 0x71, 0x28, 0x1C, 0x60, 0x72, 0x11, 0x20, 0x20, 0x73, 0x94, 0x20, 0x60, 0x73, 0xC0, 0x25, 0x65, 0x74, 0xA6, 0x74, 0x09, 0x22, 0xE2, 0x74, 0xA3, 0x4C, 0x20, 0x1C, 0x8C, 0xA1, 0x01, 0x23, 0x9E, 0x46, 0x9F, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x07, 0x22, 0x62, 0x72, 0x9E, 0x4C, 0x0A, 0x34, 0x20, 0x1C, 0x89, 0xA1, 0x01, 0x23, 0x9E, 0x46, 0x9A, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x04, 0x20 ,
0xE0, 0x71, 0x98, 0x4C, 0x12, 0x34, 0x20, 0x1C, 0x06, 0x99, 0x04, 0x22, 0x01, 0x23, 0x9E, 0x46, 0x94, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x27, 0x71, 0x93, 0x4C, 0x17, 0x34, 0x20, 0x1C, 0x07, 0x99, 0x3A, 0x1C, 0x01, 0x23, 0x9E, 0x46, 0x8E, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0xE6, 0x71, 0x01, 0x20, 0x60, 0x72, 0x11, 0x20, 0x20, 0x73, 0x94, 0x20, 0x60, 0x73, 0x02, 0x20, 0xE0, 0x73, 0x25, 0x74, 0x66, 0x74, 0xFF, 0xFF, 0x2C, 0x01, 0x18, 0x00, 0x96, 0x00, 0x00, 0x00, 0xA5, 0x74, 0x2F, 0x27, 0xE7, 0x74, 0x10, 0x20, 0x60, 0x75, 0x80, 0x26, 0xA6, 0x75, 0x01, 0x20, 0xE0, 0x75, 0x11, 0x20, 0xA0, 0x76, 0x94, 0x20, 0xE0, 0x76, 0x24, 0x20, 0x60, 0x77, 0x0A, 0x22, 0xA2, 0x77, 0x80, 0x4C, 0x36, 0x34, 0x20, 0x1C, 0x6D, 0xA1, 0x01, 0x23, 0x9E, 0x46, 0x7C, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x18, 0x22, 0xA2, 0x72, 0x7A, 0x4C, 0x41, 0x34, 0x20, 0x1C, 0x6B, 0xA1, 0x01, 0x23, 0x9E, 0x46, 0x76, 0x4B, 0xFE, 0x44, 0x18, 0x47 ,
0x25, 0x76, 0x67, 0x76, 0x21, 0x20, 0xE0, 0x76, 0x26, 0x77, 0x01, 0x20, 0x60, 0x77, 0x72, 0x48, 0x61, 0x30, 0x11, 0x21, 0x01, 0x70, 0x94, 0x21, 0x41, 0x70, 0x04, 0x21, 0x01, 0x72, 0xD2, 0x21, 0x41, 0x72, 0xC5, 0x72, 0x1E, 0x21, 0x01, 0x73, 0x45, 0x73, 0x9E, 0x21, 0x81, 0x73, 0x01, 0x21, 0x01, 0x74, 0x46, 0x74, 0x81, 0x74, 0x11, 0x21, 0x41, 0x75, 0x94, 0x21, 0x81, 0x75, 0x04, 0x21, 0x01, 0x76, 0xAD, 0x20, 0x66, 0x49, 0x08, 0x60, 0x00, 0x24, 0x0F, 0x25, 0xFF, 0xFF, 0xC2, 0x01, 0x18, 0x00, 0x96, 0x00, 0x00, 0x00, 0x29, 0x06, 0x09, 0x0E, 0x00, 0x20, 0x6A, 0x46, 0x01, 0x23, 0x9E, 0x46, 0x62, 0x4B, 0xFE, 0x44, 0x18, 0x47, 0x6B, 0x46, 0x18, 0x88, 0x40, 0x08, 0x0E, 0xD3, 0xA0, 0x00, 0x0F, 0x21, 0xCA, 0x43, 0x69, 0x46, 0x0E, 0x88, 0x16, 0x40, 0x01, 0xAF, 0x3E, 0x52, 0x49, 0x88, 0x11, 0x40, 0x68, 0x44, 0xC1, 0x80, 0x60, 0x1C, 0x04, 0x04, 0x24, 0x0C, 0x01, 0x3D, 0x0B, 0x2D, 0xE0, 0xDA, 0x60, 0x1E ,
0x00, 0x04, 0x00, 0x0C, 0x1D, 0xD0, 0x86, 0x46, 0x01, 0x1C, 0x01, 0xAD, 0x01, 0x22, 0xAE, 0x88, 0x90, 0x00, 0xC7, 0x5A, 0xB7, 0x42, 0x0A, 0xDA, 0xBC, 0x46, 0x07, 0x1C, 0x6F, 0x44, 0x7F, 0x88, 0x68, 0x44, 0x06, 0x80, 0xEE, 0x88, 0x46, 0x80, 0x60, 0x46, 0xA8, 0x80, 0xEF, 0x80, 0x04, 0x35, 0x50, 0x1C, 0x02, 0x04, 0x12, 0x0C, 0x01, 0x39, 0xE9, 0xD1, 0x70, 0x46, 0x01, 0x38, 0x86, 0x46, 0xE2, 0xD1, 0x99, 0x88, 0x68, 0x46, 0xC0, 0x88, 0x40, 0x18, 0x00, 0x04, 0x00, 0x0C, 0x42, 0x4B, 0x18, 0x80, 0x42, 0x49, 0x08, 0x1A, 0xFF, 0xFF, 0x58, 0x02, 0x18, 0x00, 0x96, 0x00, 0x00, 0x00, 0x58, 0x80, 0x02, 0x2C, 0x1E, 0xDB, 0x65, 0x1E, 0x01, 0xAA, 0x01, 0x20, 0x01, 0x1C, 0x8C, 0x00, 0x6B, 0x46, 0xE6, 0x5A, 0x93, 0x88, 0xD4, 0x88, 0xE7, 0x18, 0xB7, 0x42, 0x0C, 0xDA, 0x06, 0x24, 0x44, 0x43, 0x38, 0x4B, 0x1B, 0x19, 0x1F, 0x80, 0x1C, 0x88, 0x34, 0x1B, 0x5C, 0x80, 0x01, 0x24, 0x1C, 0x71, 0x40, 0x1C, 0x00, 0x04 ,
0x00, 0x0C, 0x04, 0x32, 0x49, 0x1C, 0x09, 0x06, 0x09, 0x0E, 0x01, 0x3D, 0xE4, 0xD1, 0x00, 0x24, 0x31, 0x48, 0x04, 0x70, 0x31, 0x48, 0x04, 0x70, 0x31, 0x48, 0x04, 0x70, 0x31, 0x48, 0x04, 0x70, 0x01, 0x20, 0x86, 0x46, 0x30, 0x48, 0xFE, 0x44, 0x00, 0x47, 0x2F, 0x49, 0x22, 0x1C, 0x08, 0x68, 0x00, 0x28, 0x02, 0xD0, 0x01, 0x20, 0x90, 0x40, 0x04, 0x43, 0x04, 0x31, 0x01, 0x32, 0x20, 0x2A, 0xF5, 0xD3, 0x2A, 0x48, 0x04, 0x60, 0x08, 0xB0, 0xF0, 0xBD, 0x5F, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2D, 0x69, 0x6E, 0x66, 0x6F, 0x00, 0xC0, 0x46, 0xC0, 0x5F, 0x75, 0x64, 0x70, 0x00, 0xC0, 0xFF, 0xFF, 0xEE, 0x02, 0x18, 0x00, 0x96, 0x00, 0x00, 0x00, 0x46, 0xC0, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x00, 0xC0, 0x46, 0x5F, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x00, 0xC0, 0x46, 0x5F, 0x64, 0x6E, 0x73, 0x2D, 0x73, 0x64, 0x00, 0x64, 0x65, 0x76, 0x3D, 0x43, 0x43, 0x33, 0x30, 0x30, 0x30, 0x00, 0xC0, 0x76, 0x65 ,
0x6E, 0x64, 0x6F, 0x72, 0x3D, 0x54, 0x65, 0x78, 0x61, 0x73, 0x2D, 0x49, 0x6E, 0x73, 0x74, 0x72, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x73, 0x00, 0xC0, 0x46, 0xC0, 0x00, 0x00, 0x18, 0x00, 0xF3, 0x7E, 0x03, 0x00, 0xC6, 0x05, 0x00, 0x00, 0xDD, 0x7E, 0x03, 0x00, 0xE4, 0x62, 0x08, 0x00, 0xC9, 0xBA, 0x03, 0x00, 0x09, 0xB4, 0x03, 0x00, 0xA7, 0x64, 0x08, 0x00, 0x70, 0x64, 0x08, 0x00, 0xDD, 0x0A, 0x02, 0x00, 0x48, 0x32, 0x08, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xE8, 0x62, 0x08, 0x00, 0xE9, 0x62, 0x08, 0x00, 0xEA, 0x62, 0x08, 0x00, 0xEB, 0x62, 0x08, 0x00, 0x81, 0x03, 0x18, 0x00, 0x80, 0x7B, 0x08, 0x00, 0x84, 0xF3, 0x1A, 0x00, 0x0D, 0x49, 0x0E, 0x48, 0xFF, 0xFF, 0x84, 0x03, 0x18, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x88, 0x67, 0x0E, 0x48, 0x88, 0x64, 0x0E, 0x48, 0x48, 0x64, 0x0E, 0x48, 0xC8, 0x64, 0x0E, 0x48, 0x08, 0x65, 0x11, 0x48, 0x02, 0x1C, 0x04, 0x32, 0x0C, 0x4B, 0x13, 0x60, 0x0C, 0x4B, 0x93, 0x62, 0x0C, 0x4A ,
0x8A, 0x66, 0x0D, 0x49, 0x01, 0x60, 0x0D, 0x48, 0x0E, 0x49, 0x01, 0x60, 0x0E, 0x49, 0x41, 0x60, 0xF7, 0x46, 0x1C, 0x21, 0x08, 0x00, 0x1B, 0x7B, 0x08, 0x00, 0x11, 0x7B, 0x08, 0x00, 0x07, 0x7B, 0x08, 0x00, 0x39, 0x7B, 0x08, 0x00, 0x2F, 0x7B, 0x08, 0x00, 0x25, 0x7B, 0x08, 0x00, 0xFD, 0x7A, 0x08, 0x00, 0xDF, 0x7A, 0x08, 0x00, 0x50, 0x23, 0x08, 0x00, 0xD5, 0x7A, 0x08, 0x00, 0x58, 0x26, 0x08, 0x00, 0xF3, 0x7A, 0x08, 0x00, 0xE9, 0x7A, 0x08, 0x00 };
const unsigned char cRMdefaultParams[128] = { 0x03, 0x00, 0x01, 0x01, 0x14, 0x14, 0x00, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x23, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x23, 0x23, 0x23, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x01, 0x77, 0x80, 0x1D, 0x1F, 0x22, 0x26, 0x28, 0x29, 0x1A, 0x1F, 0x22, 0x24, 0x26, 0x28, 0x16, 0x1D, 0x1E, 0x20, 0x24, 0x25, 0x1E, 0x2D, 0x01, 0x02, 0x02, 0x02, 0x02, 0x00, 0x15, 0x15, 0x15, 0x11, 0x15, 0x15, 0x0E, 0x00};
//
//Service Pack version P1.13.7.15.15 - FW patches
//
const unsigned char fw_patch[5700] = { 0x00, 0x01, 0x00, 0x00, 0x3C, 0x16, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x14, 0x03, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x68, 0x46, 0x25, 0xF0, 0x95, 0xFB, 0xE0, 0x6B, 0xD0, 0x03, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x25, 0xF0, 0x38, 0xFB, 0x2C, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x25, 0xF0, 0x0A, 0xFB, 0x04, 0x15, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xB8, 0xF1, 0x90, 0x0F, 0xA4, 0x16, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x66, 0xE0, 0x04, 0xA8, 0x35, 0x1D, 0x21, 0xF0, 0x99, 0xFC, 0x68, 0x46, 0x23, 0xF0, 0x28, 0xFB, 0x9A, 0xF8, 0x00, 0x00, 0x01, 0x28, 0x07, 0xD1, 0x28, 0x46, 0x05, 0xF0, 0xC3, 0xFE, 0x01, 0x46, 0x01, 0xAA, 0x00, 0x20, 0x21, 0xF0, 0x50, 0xF9, 0x28, 0x46, 0x05, 0xF0, 0xBB, 0xFE, 0x01, 0xA9, 0x21, 0xF0, 0x2A, 0xFA, 0xE9, 0x79, 0x4F, 0xEA, 0xE0, 0x00, 0x40, 0xB2, 0x11, 0xB1, 0x00, 0xF1, 0x06, 0x00, 0x40, 0xB2, 0xA8, 0x71, 0x1F, 0x38, 0x40, 0x00, 0xE8, 0x71, 0x30, 0x46 ,
0x01, 0xF0, 0x0D, 0xFF, 0x10, 0xF1, 0x00, 0x09, 0x4F, 0xF0, 0x00, 0x01, 0x09, 0xD0, 0x28, 0x68, 0x40, 0x0C, 0x09, 0xD3, 0xE8, 0x68, 0xC0, 0x0B, 0x03, 0xD2, 0x48, 0x46, 0xFF, 0xF7, 0xDD, 0xFE, 0x01, 0x21, 0x28, 0x68, 0x40, 0x0C, 0x0A, 0xD2, 0x38, 0x68, 0x40, 0x1C, 0x38, 0x60, 0x20, 0x68, 0x6F, 0xF3, 0x0F, 0x00, 0x20, 0x60, 0x22, 0x68, 0x38, 0x68, 0x10, 0x43, 0x20, 0x60, 0xE8, 0x68, 0xC0, 0x0B, 0x0F, 0xD3, 0xD8, 0xF8, 0x00, 0x00, 0x00, 0xF1, 0x01, 0x00, 0xC8, 0xF8, 0x00, 0x00, 0x20, 0x68, 0x6F, 0xF3, 0x1F, 0x40, 0x20, 0x60, 0xD8, 0xF8, 0x00, 0x20, 0x20, 0x68, 0x40, 0xEA, 0x02, 0x40, 0x20, 0x60, 0x49, 0xB9, 0xB9, 0xF1, 0x00, 0x0F, 0x03, 0xD1, 0x30, 0x46, 0x07, 0xF0, 0xBE, 0xF9, 0x02, 0xE0, 0x48, 0x46, 0x07, 0xF0, 0x06, 0xFA, 0x6C, 0x17, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x68, 0x46, 0x0E, 0xF0, 0x85, 0xFB, 0x00, 0x9E, 0x00, 0x2E, 0x96, 0xD1, 0x05, 0xB0, 0xBD, 0xE8, 0xF0, 0x87, 0xC0, 0x46 ,
0x9C, 0x20, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x23, 0xF0, 0x2A, 0xFE, 0x74, 0x47, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0B, 0x21, 0x21, 0xF0, 0x41, 0xFA, 0x20, 0x68, 0x18, 0x4B, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x21, 0xF0, 0x1C, 0xF9, 0x0A, 0xE0, 0x20, 0x68, 0x00, 0x68, 0x0C, 0x21, 0x40, 0xF0, 0x20, 0x00, 0x21, 0xF0, 0x14, 0xF9, 0x10, 0x57, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0xA8, 0x20, 0xF0, 0x97, 0xF9, 0x01, 0x98, 0x5C, 0x57, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0xA8, 0x20, 0xF0, 0x71, 0xF9, 0x03, 0x98, 0x00, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0xF0, 0x20, 0xF9, 0x1C, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0xF0, 0x12, 0xF9, 0x54, 0x58, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0xA8, 0x20, 0xF0, 0xF5, 0xF8, 0x04, 0xAB, 0x04, 0x62, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x79, 0x1F, 0xF0, 0x1B, 0xFD, 0x69, 0xE0, 0x60, 0x93, 0x00, 0x00, 0x40, 0x00 ,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0xA6, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x78, 0x1B, 0xF0, 0x39, 0xFB, 0x28, 0x46, 0x90, 0xA8, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x78, 0x1B, 0xF0, 0x69, 0xF9, 0x1E, 0x48, 0x34, 0xAD, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x68, 0xFF, 0x29, 0x98, 0xAD, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10, 0xD4, 0x21, 0xD4, 0xB2, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0xD0, 0x1A, 0xF0, 0x47, 0xFC, 0x20, 0x98, 0xAC, 0xC5, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x78, 0x19, 0xF0 ,
0xDB, 0xFA, 0x09, 0x49, 0x28, 0xC6, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x19, 0xF0, 0x9E, 0xFA, 0xDC, 0xD3, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xB5, 0x18, 0xF0, 0xAB, 0xFC, 0x00, 0xF0, 0x03, 0xF8, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xDF, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x17, 0xF0, 0xA8, 0xFD, 0xCC, 0xEB, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x38, 0x78, 0x17, 0xF0, 0x77, 0xF8, 0x38, 0x78, 0x16, 0xF0, 0xF0, 0xFF, 0xA8, 0xF7, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0E, 0x49, 0x09, 0x68, 0x23, 0x22, 0x41, 0x61, 0xC8, 0xF7, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x31, 0x2E, 0x31, 0x39, 0x2E, 0x33, 0x31, 0x34, 0x5F, 0x4E, 0x65, 0x77, 0x5F, 0x43, 0x43, 0x41, 0x5F, 0x61, 0x6C, 0x67, 0x6F, 0x72, 0x69, 0x74, 0x68, 0x6D, 0x00, 0xC0, 0x74, 0x56, 0x30, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0xF9, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0xA8, 0x16, 0xF0, 0x79, 0xF8 ,
0x12, 0xE0, 0x38, 0xFA, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0xA8, 0x16, 0xF0, 0x03, 0xF8, 0x32, 0x20, 0x94, 0xFB, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x0C, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x05, 0xA8, 0x14, 0xF0, 0x05, 0xFF, 0x01, 0xF0, 0x10, 0x1B, 0x01, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x1E, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xF0, 0x46, 0xBF, 0x18, 0x30, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x30, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0xF0, 0xD8, 0xFC, 0x9C, 0x31, 0x01, 0x00, 0x08, 0x00 ,
0x00, 0x00, 0x68, 0x46, 0x12, 0xF0, 0x51, 0xFC, 0xFE, 0xF7, 0xF0, 0x35, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x68, 0x46, 0x12, 0xF0, 0x27, 0xFA, 0xFE, 0xF7, 0xF0, 0x3D, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x05, 0xA9, 0x11, 0xF0, 0x27, 0xFE, 0x20, 0x6F, 0xD0, 0x62, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0F, 0xF0, 0xB8, 0xFB, 0x80, 0x7E, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0xDF, 0xF8, 0x58, 0x82, 0xE0, 0x7E, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0D, 0xF0, 0x6A, 0xFE, 0x0B, 0xF0, 0x9A, 0xF9, 0x03, 0x20, 0xA8, 0xF5, 0x88, 0x71, 0x08, 0x60, 0xF2, 0xF7, 0x16, 0xF9, 0x7A, 0x48, 0x6B, 0x49, 0x9C, 0x7F, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x70, 0x51, 0x4D, 0xC4, 0x7F, 0x01, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x40, 0x49, 0x00, 0xF1, 0x52, 0x00, 0x3A, 0x4A, 0xA8, 0x81, 0x28, 0x83, 0xE8, 0x83, 0xE8, 0x84, 0xA8, 0x85, 0x2A, 0x60, 0x39, 0x48, 0x41, 0xF2, 0x11, 0x12, 0x2A, 0x85, 0x18, 0x90, 0x19, 0x91 ,
0x39, 0x49, 0x1A, 0x91, 0x39, 0x49, 0x1B, 0x91, 0x39, 0x49, 0x20, 0x46, 0xDF, 0xF8, 0xC4, 0x90, 0x1C, 0x91, 0x38, 0x49, 0xDF, 0xF8, 0xC0, 0xB0, 0x31, 0x4E, 0x1D, 0x91, 0x48, 0x80, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xF0, 0x7C, 0xFA, 0xB4, 0x80, 0x01, 0x00, 0x34, 0x00, 0x00, 0x00, 0x34, 0x12, 0x66, 0x09, 0x84, 0x6B, 0x00, 0x20, 0x94, 0x70, 0x00, 0x20, 0xB4, 0x70, 0x00, 0x20, 0xC4, 0x78, 0x00, 0x20, 0x50, 0x7A, 0x00, 0x20, 0xFE, 0xFF, 0x03, 0x00, 0xA4, 0x70, 0x00, 0x20, 0xB0, 0x70, 0x00, 0x20, 0xB8, 0x70, 0x00, 0x20, 0x60, 0x55, 0x30, 0x80, 0x3C, 0x5C, 0x00, 0x20, 0x04, 0x74, 0x00, 0x20, 0xB8, 0xE4, 0x01, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x20, 0x78, 0x07, 0xF0, 0x01, 0xFC, 0x20, 0x78, 0x07, 0xF0, 0x7A, 0xFB, 0x04, 0x4D, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x2D, 0xE9, 0xF0, 0x4F, 0xAD, 0xF1, 0x8C, 0x0D, 0x04, 0x68, 0x0F, 0x30, 0x03, 0x94, 0xFE, 0xF7, 0xDB, 0xFA, 0x04, 0xF1, 0x14, 0x00 ,
0x04, 0x90, 0x21, 0x7D, 0x00, 0x20, 0x21, 0xF0, 0x73, 0x01, 0x88, 0x29, 0x08, 0xBF, 0x01, 0x20, 0x05, 0x90, 0x03, 0x98, 0x00, 0x1D, 0x06, 0x90, 0x5D, 0x48, 0x00, 0x68, 0x01, 0x28, 0x40, 0xF0, 0xFA, 0x83, 0x5B, 0x4D, 0x5C, 0x48, 0xDF, 0xF8, 0x70, 0x91, 0x29, 0x68, 0xDF, 0xF8, 0x70, 0x81, 0xDF, 0xF8, 0x74, 0xA1, 0x88, 0x42, 0x21, 0xD1, 0x10, 0x22, 0x00, 0x21, 0x48, 0x46, 0x4F, 0x46, 0xFB, 0xF7, 0xB7, 0xFE, 0x10, 0x22, 0x00, 0x21, 0x40, 0x46, 0xFB, 0xF7, 0xB2, 0xFE, 0x54, 0x49, 0x08, 0x68, 0x40, 0xF4, 0x80, 0x10, 0x08, 0x60, 0x01, 0x20, 0x51, 0x46, 0x08, 0x60, 0x00, 0x21, 0x29, 0x60, 0x39, 0x78, 0x46, 0x46, 0x00, 0x91, 0x31, 0x78, 0x41, 0xF2, 0x11, 0x13, 0x04, 0x22, 0x01, 0x91, 0x07, 0x21, 0x02, 0x90, 0x03, 0x20, 0xF3, 0xF7, 0x41, 0xFC, 0x51, 0x46, 0x07, 0x91, 0x08, 0x68, 0x56, 0x49, 0xDF, 0xF8, 0x5C, 0xB1, 0x01, 0x28, 0x08, 0x91, 0x56, 0x49, 0xDF, 0xF8, 0x48, 0xA1, 0x09, 0x91, 0x55, 0x49 ,
0x0A, 0x91, 0x44, 0x49, 0x0B, 0x91, 0x44, 0x49, 0x0C, 0x91, 0x44, 0x49, 0x0D, 0x91, 0x44, 0x49, 0x0E, 0x91, 0x44, 0x49, 0x0F, 0x91, 0x44, 0x49, 0x10, 0x91, 0x44, 0x49, 0xCC, 0x4D, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x11, 0x91, 0x44, 0x49, 0x12, 0x91, 0x44, 0x49, 0x13, 0x91, 0x44, 0x49, 0x14, 0x91, 0x44, 0x49, 0x15, 0x91, 0x44, 0x49, 0x16, 0x91, 0x9F, 0x49, 0x17, 0x91, 0x9F, 0x49, 0x18, 0x91, 0x9F, 0x49, 0x19, 0x91, 0x9F, 0x49, 0x1A, 0x91, 0x9F, 0x49, 0x1B, 0x91, 0x9F, 0x49, 0x1C, 0x91, 0x9F, 0x49, 0x1D, 0x91, 0x9F, 0x49, 0x1E, 0x91, 0x9F, 0x49, 0x1F, 0x91, 0x40, 0xF0, 0x00, 0x81, 0x04, 0x98, 0x40, 0x78, 0x00, 0xF0, 0x03, 0x01, 0x01, 0x29, 0x40, 0xF0, 0xF9, 0x80, 0x04, 0x99, 0x09, 0x78, 0x01, 0xF0, 0x0C, 0x01, 0x08, 0x29, 0x40, 0xF0, 0xF2, 0x80, 0x06, 0x99, 0x09, 0x88, 0xA1, 0xF1, 0x3C, 0x01, 0x0E, 0xB2, 0x05, 0x99, 0x11, 0xB1, 0xA6, 0xF1, 0x02, 0x06, 0x36, 0xB2, 0xC0, 0x09, 0x4F, 0xF0 ,
0x00, 0x07, 0x15, 0xD3, 0x08, 0x3E, 0x36, 0xB2, 0x03, 0x2E, 0x10, 0xD0, 0x17, 0x2E, 0x0E, 0xD0, 0x08, 0x3E, 0x36, 0xB2, 0x03, 0x2E, 0x08, 0xD0, 0x17, 0x2E, 0x06, 0xD0, 0x36, 0x1F, 0x36, 0xB2, 0x03, 0x2E, 0x14, 0xBF, 0x17, 0x2E, 0x02, 0x27, 0x02, 0xE0, 0x03, 0x27, 0x00, 0xE0, 0x01, 0x27, 0x03, 0x2E, 0x18, 0xBF, 0x17, 0x2E, 0x04, 0x9A, 0x40, 0xF0, 0xC8, 0x80, 0x0A, 0x32, 0x12, 0xF8, 0x01, 0x1B, 0x05, 0x24, 0x12, 0xF8, 0x01, 0x3B, 0x4B, 0x40, 0x64, 0x1E, 0xD9, 0xB2, 0xF9, 0xD1, 0x81, 0xEA, 0x21, 0x11, 0x03, 0x2E, 0x94, 0x4E, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x01, 0xF0, 0x0F, 0x01, 0x48, 0x46, 0x35, 0xD0, 0x43, 0x46, 0xCA, 0x5C, 0x52, 0x1C, 0xCA, 0x54, 0x0C, 0x18, 0x33, 0xE0, 0x50, 0x57, 0x02, 0x00, 0x04, 0x74, 0x00, 0x20, 0x34, 0x12, 0x66, 0x09, 0x60, 0x57, 0x02, 0x00, 0x70, 0x57, 0x02, 0x00, 0xC8, 0x48, 0x30, 0x80, 0x4C, 0x57, 0x02, 0x00, 0x88, 0x57, 0x02, 0x00, 0x80, 0x57, 0x02, 0x00 ,
0x18, 0x58, 0x02, 0x00, 0x20, 0x58, 0x02, 0x00, 0x28, 0x58, 0x02, 0x00, 0x30, 0x58, 0x02, 0x00, 0x38, 0x58, 0x02, 0x00, 0x40, 0x58, 0x02, 0x00, 0xE4, 0x58, 0x02, 0x00, 0xE2, 0x58, 0x02, 0x00, 0x14, 0x58, 0x02, 0x00, 0xEF, 0x58, 0x02, 0x00, 0xE0, 0x58, 0x02, 0x00, 0xEE, 0x58, 0x02, 0x00, 0x5C, 0x57, 0x02, 0x00, 0xE6, 0x58, 0x02, 0x00, 0xE8, 0x58, 0x02, 0x00, 0x0C, 0x18, 0x20, 0x78, 0x40, 0x1C, 0x20, 0x70, 0x20, 0x78, 0x43, 0x46, 0x03, 0xEB, 0x01, 0x08, 0x0A, 0x28, 0x76, 0xDB, 0x98, 0xF8, 0x00, 0x00, 0x0A, 0x28, 0x72, 0xDB, 0x94, 0x48, 0x00, 0x25, 0x01, 0x60, 0x04, 0x98, 0x00, 0xF1, 0x0A, 0x09, 0x40, 0x78, 0x41, 0x08, 0x24, 0xBF, 0x04, 0x99, 0x09, 0x1D, 0x04, 0xD2, 0x80, 0x08, 0x2E, 0xBF, 0x49, 0x46, 0x04, 0x99, 0x10, 0x31, 0x0B, 0x98, 0x06, 0x22, 0xFA, 0xF7, 0xB9, 0xFC, 0x0C, 0x98, 0x06, 0x22, 0x49, 0x46, 0xFA, 0xF7, 0xB4, 0xFC, 0x9B, 0x48, 0x9A, 0x49, 0x5C, 0x4F, 0x02, 0x00, 0xC8, 0x00 ,
0x00, 0x00, 0x00, 0x78, 0x08, 0x22, 0x08, 0x60, 0x58, 0x46, 0x07, 0x60, 0x0D, 0x98, 0x29, 0x46, 0xFB, 0xF7, 0xAF, 0xFD, 0x08, 0x22, 0x0E, 0x98, 0x29, 0x46, 0xFB, 0xF7, 0xAA, 0xFD, 0x08, 0x22, 0x0F, 0x98, 0x29, 0x46, 0xFB, 0xF7, 0xA5, 0xFD, 0x08, 0x22, 0x10, 0x98, 0x29, 0x46, 0xFB, 0xF7, 0xA0, 0xFD, 0x08, 0x22, 0x11, 0x98, 0x29, 0x46, 0xFB, 0xF7, 0x9B, 0xFD, 0x08, 0x22, 0x12, 0x98, 0x29, 0x46, 0xFB, 0xF7, 0x96, 0xFD, 0x07, 0x99, 0x02, 0x20, 0x08, 0x60, 0x13, 0x99, 0x28, 0x46, 0x08, 0x80, 0x08, 0x99, 0x08, 0x70, 0x14, 0x99, 0x08, 0x70, 0x15, 0x99, 0x08, 0x60, 0x16, 0x99, 0x08, 0x70, 0x17, 0x99, 0x08, 0x60, 0x18, 0x99, 0x08, 0x60, 0x19, 0x99, 0x08, 0x60, 0x09, 0x99, 0x08, 0x80, 0x0A, 0x99, 0x08, 0x80, 0x1A, 0x99, 0x08, 0x80, 0x7D, 0x49, 0x0D, 0x60, 0x1B, 0x99, 0x08, 0x70, 0x1C, 0x99, 0x08, 0x70, 0x1D, 0x99, 0x08, 0x70, 0x1E, 0x99, 0x08, 0x80, 0x1F, 0x99, 0x08, 0x80, 0x51, 0x46, 0x08, 0x80 ,
0x20, 0x78, 0x00, 0x96, 0x04, 0x22, 0x01, 0x90, 0x98, 0xF8, 0x00, 0x00, 0x41, 0xF2, 0x14, 0x13, 0x07, 0x21, 0x02, 0x90, 0x03, 0x20, 0xF3, 0xF7, 0x07, 0xFB, 0x07, 0x98, 0xA2, 0x49, 0x00, 0x68, 0x20, 0x91, 0xA2, 0x49, 0x05, 0x28, 0x21, 0x91, 0x9E, 0x49, 0x22, 0x91, 0x40, 0xF0, 0x37, 0x82, 0x04, 0x98, 0x40, 0x78, 0x24, 0x50, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x41, 0x08, 0x24, 0xBF, 0x04, 0x99, 0x09, 0x1D, 0x05, 0xD2, 0x80, 0x08, 0x27, 0xBF, 0x04, 0x99, 0x0A, 0x31, 0x04, 0x99, 0x10, 0x31, 0x0B, 0x98, 0xF8, 0xF7, 0x2D, 0xFC, 0x01, 0x28, 0x04, 0x98, 0x40, 0xF0, 0x23, 0x82, 0x40, 0x78, 0x00, 0xF0, 0x03, 0x00, 0x03, 0x28, 0x18, 0xD0, 0x02, 0x28, 0x07, 0xBF, 0x04, 0x99, 0x10, 0x31, 0x04, 0x99, 0x0A, 0x31, 0x13, 0xE0, 0x48, 0x58, 0x02, 0x00, 0x4C, 0x58, 0x02, 0x00, 0x50, 0x58, 0x02, 0x00, 0xF0, 0x58, 0x02, 0x00, 0xF2, 0x58, 0x02, 0x00, 0xF3, 0x58, 0x02, 0x00, 0xF4, 0x58, 0x02, 0x00, 0xEA, 0x58 ,
0x02, 0x00, 0xEC, 0x58, 0x02, 0x00, 0x04, 0x99, 0x18, 0x31, 0x0C, 0x98, 0xF8, 0xF7, 0x06, 0xFC, 0x04, 0x99, 0x01, 0x28, 0x40, 0xF0, 0xFC, 0x81, 0x49, 0x78, 0x01, 0xF0, 0x03, 0x01, 0x01, 0x29, 0x40, 0xF0, 0xF6, 0x81, 0x59, 0x46, 0x09, 0x68, 0x04, 0x9A, 0x8E, 0x46, 0x51, 0x46, 0xD2, 0x8A, 0x0B, 0x88, 0x12, 0x11, 0x93, 0x42, 0x00, 0xF0, 0x37, 0x82, 0x0A, 0x80, 0x06, 0x99, 0x09, 0x88, 0x3C, 0x39, 0x0B, 0xB2, 0x71, 0x46, 0x49, 0x1E, 0x09, 0xD0, 0x49, 0x1E, 0x04, 0xD0, 0x49, 0x1E, 0x08, 0xD1, 0xA3, 0xF1, 0x10, 0x03, 0x04, 0xE0, 0xA3, 0xF1, 0x14, 0x03, 0x01, 0xE0, 0xA3, 0xF1, 0x08, 0x03, 0x1B, 0xB2, 0x05, 0x98, 0x10, 0xB1, 0xA3, 0xF1, 0x02, 0x03, 0x1B, 0xB2, 0xEC, 0x50, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0xF1, 0xCE, 0x81, 0x16, 0x98, 0x40, 0xF2, 0x77, 0x51, 0x99, 0x42, 0x0B, 0x90, 0x14, 0x98, 0x05, 0x90, 0x00, 0xF0, 0xA3, 0x81, 0x08, 0x46, 0x00, 0xF1, 0x3C, 0x00, 0x98, 0x42 ,
0x05, 0x9A, 0x00, 0xF0, 0x9A, 0x81, 0xDF, 0xF8, 0x48, 0x82, 0x14, 0x78, 0x0B, 0x9A, 0xBB, 0x2C, 0x12, 0x78, 0x0C, 0x92, 0x63, 0xD1, 0xDD, 0xF8, 0x68, 0xC0, 0xBC, 0xF9, 0x00, 0x20, 0x91, 0x42, 0x18, 0xBF, 0x90, 0x42, 0x5B, 0xD1, 0x1C, 0x2B, 0x4F, 0xF0, 0x00, 0x00, 0xC0, 0xF2, 0x82, 0x81, 0x3D, 0x2B, 0x13, 0x9D, 0x80, 0xF2, 0x7E, 0x81, 0xA3, 0xF1, 0x1C, 0x01, 0x09, 0xB2, 0x29, 0x80, 0x1E, 0x9A, 0xDD, 0xF8, 0x30, 0x90, 0xB2, 0xF9, 0x00, 0x60, 0xB9, 0xF1, 0x01, 0x0F, 0x15, 0xD1, 0xDD, 0xF8, 0x24, 0x90, 0x03, 0x2E, 0x0D, 0xDA, 0xB9, 0xF9, 0x00, 0x70, 0xB9, 0x42, 0x07, 0xD0, 0x01, 0x26, 0x16, 0x80, 0x4A, 0x46, 0x0E, 0x46, 0x03, 0xE0, 0xC0, 0x46, 0x90, 0x57, 0x02, 0x00, 0x76, 0x1C, 0x16, 0x80, 0x1B, 0x9A, 0x16, 0x78, 0x1D, 0x9A, 0x16, 0x70, 0x0C, 0x9A, 0x1F, 0x9E, 0x02, 0x2A, 0x28, 0xD1, 0xB6, 0xF9, 0x00, 0x20, 0xBE, 0xF1, 0x00, 0x0F, 0x1A, 0xD0, 0x03, 0x2A, 0x35, 0x46, 0x0B, 0xDA, 0x0A, 0x9E ,
0xB6, 0xF9, 0x00, 0x70, 0xB9, 0x42, 0x04, 0xD0, 0x01, 0x22, 0x2A, 0x80, 0x0A, 0x46, 0x35, 0x46, 0x00, 0xE0, 0xB4, 0x51, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x52, 0x1C, 0x2A, 0x80, 0x1C, 0x99, 0x0A, 0x78, 0x1D, 0x99, 0x0A, 0x70, 0x0F, 0xE0, 0xC0, 0x46, 0x58, 0x57, 0x02, 0x00, 0xA6, 0x64, 0x00, 0x20, 0x54, 0x57, 0x02, 0x00, 0x28, 0x80, 0x05, 0x99, 0x08, 0x70, 0x08, 0x9A, 0x11, 0x78, 0x41, 0xF0, 0x04, 0x01, 0x11, 0x70, 0x04, 0x46, 0x45, 0x46, 0xAC, 0xF8, 0x00, 0x00, 0x28, 0x70, 0xCC, 0x2C, 0x09, 0x9A, 0x40, 0xF0, 0x00, 0x81, 0xDD, 0xF8, 0x7C, 0xC0, 0x0A, 0x99, 0x1E, 0x9F, 0x45, 0x46, 0xB1, 0xF9, 0x00, 0x60, 0xB2, 0xF9, 0x00, 0x90, 0x28, 0x78, 0xCD, 0xF8, 0x50, 0xC0, 0x16, 0x91, 0x0A, 0x97, 0x13, 0x92, 0x09, 0x95, 0x0C, 0x99, 0x01, 0x29, 0x05, 0xD1, 0x05, 0x9A, 0xB0, 0xEB, 0x49, 0x0F, 0x01, 0xD1, 0x00, 0x21, 0x11, 0x70, 0x0C, 0x99, 0x02, 0x29, 0x05, 0xD1, 0x05, 0x9A, 0xB0, 0xEB, 0x46, 0x0F ,
0x01, 0xD1, 0x00, 0x21, 0x11, 0x70, 0xB3, 0xF5, 0x14, 0x7F, 0x40, 0xF3, 0xBA, 0x80, 0x40, 0xF2, 0x51, 0x31, 0x99, 0x42, 0x08, 0x99, 0x40, 0xF3, 0xB4, 0x80, 0x09, 0x78, 0x06, 0x29, 0x00, 0xF0, 0xB0, 0x80, 0xA3, 0xF2, 0x51, 0x21, 0x0B, 0xB2, 0x4F, 0xEA, 0xE3, 0x01, 0x03, 0xEB, 0x11, 0x71, 0x4F, 0xEA, 0x21, 0x11, 0xCA, 0xB2, 0x4F, 0xEA, 0xE3, 0x01, 0x03, 0xEB, 0x11, 0x71, 0x15, 0x9D, 0x21, 0xF0, 0x0F, 0x01, 0xA3, 0xEB, 0x01, 0x03, 0x1D, 0x99, 0x2E, 0x68, 0x7C, 0x52, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x91, 0xF8, 0x00, 0xE0, 0x5F, 0xFA, 0x83, 0xF8, 0x60, 0xB1, 0x31, 0x18, 0x11, 0xF8, 0x01, 0x1C, 0x51, 0x40, 0xCB, 0xB2, 0x07, 0xE0, 0xC0, 0x46, 0x58, 0x58, 0x02, 0x00, 0x54, 0x58, 0x02, 0x00, 0xDC, 0x58, 0x02, 0x00, 0x13, 0x46, 0x19, 0x99, 0xDD, 0xF8, 0x6C, 0xA0, 0xDD, 0xF8, 0x70, 0xB0, 0xD1, 0xF8, 0x00, 0xC0, 0x00, 0xF0, 0x0F, 0x01, 0x99, 0x42, 0x22, 0xD0, 0x0A, 0x9B, 0x86, 0x45, 0x9A, 0xF8 ,
0x00, 0x10, 0xB3, 0xF9, 0x00, 0x30, 0x9B, 0xF8, 0x00, 0x50, 0x15, 0xDD, 0x37, 0x5C, 0x44, 0x1C, 0x82, 0xEA, 0x07, 0x0C, 0x04, 0xF0, 0x0F, 0x07, 0x67, 0x45, 0x0B, 0xD0, 0xA6, 0x45, 0x06, 0x44, 0x0A, 0xDD, 0x76, 0x78, 0x72, 0x40, 0x86, 0x1C, 0x06, 0xF0, 0x0F, 0x06, 0x96, 0x42, 0x03, 0xD1, 0xC0, 0x1C, 0x4D, 0xE0, 0x80, 0x1C, 0x4B, 0xE0, 0x05, 0x9E, 0x00, 0x22, 0x32, 0x70, 0x4A, 0xE0, 0x00, 0xF0, 0x1F, 0x01, 0x01, 0x22, 0x8A, 0x40, 0x17, 0x99, 0xC4, 0x10, 0x0B, 0x68, 0x24, 0xF0, 0x03, 0x01, 0x5C, 0xF8, 0x01, 0x70, 0x3A, 0x42, 0x32, 0xD1, 0x5F, 0x58, 0x3A, 0x42, 0x06, 0x44, 0x1F, 0xD0, 0x18, 0x9B, 0x37, 0x78, 0x1B, 0x68, 0xB8, 0x45, 0x04, 0xD1, 0x58, 0x58, 0x02, 0x42, 0x19, 0xD0, 0x63, 0x46, 0x15, 0xE0, 0xA1, 0x10, 0x8C, 0x00, 0x19, 0x59, 0x91, 0x43, 0x19, 0x51, 0x00, 0x90, 0x30, 0x78, 0x01, 0x90, 0x44, 0x53, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x03, 0x20, 0x06, 0x21, 0x02, 0x46, 0x4D, 0xF6 ,
0x80, 0x53, 0xF3, 0xF7, 0x63, 0xF9, 0x09, 0x99, 0x28, 0x68, 0x0E, 0x78, 0x36, 0x18, 0x06, 0xE0, 0xE3, 0x58, 0x02, 0x00, 0xA0, 0x10, 0x81, 0x00, 0x58, 0x58, 0x02, 0x43, 0x5A, 0x50, 0x86, 0xF8, 0x00, 0x80, 0x0B, 0x98, 0x00, 0x78, 0x0C, 0x90, 0x13, 0x98, 0xB0, 0xF9, 0x00, 0x90, 0x09, 0x98, 0x00, 0x78, 0x0A, 0x9A, 0x40, 0x1C, 0x9B, 0xF8, 0x00, 0x50, 0x9A, 0xF8, 0x00, 0x10, 0xB2, 0xF9, 0x00, 0x30, 0x09, 0x9A, 0xC0, 0xB2, 0x10, 0x70, 0x0C, 0x9A, 0x01, 0x2A, 0x03, 0xD1, 0x88, 0x42, 0xC8, 0xBF, 0x8A, 0xF8, 0x00, 0x00, 0x0C, 0x99, 0x02, 0x29, 0x07, 0xD1, 0xA8, 0x42, 0xC8, 0xBF, 0x8B, 0xF8, 0x00, 0x00, 0x02, 0xE0, 0x0A, 0x98, 0xB0, 0xF9, 0x00, 0x30, 0xB9, 0xF1, 0x00, 0x0F, 0x06, 0xDD, 0x03, 0x2B, 0x04, 0xD1, 0x11, 0x98, 0x01, 0x22, 0x49, 0x46, 0x00, 0xF0, 0x72, 0xFB, 0x16, 0x98, 0xB0, 0xF9, 0x00, 0x10, 0x14, 0x98, 0x00, 0x29, 0xB0, 0xF9, 0x00, 0x00, 0x05, 0xDD, 0x03, 0x28, 0x03, 0xD1, 0x12, 0x98 ,
0x02, 0x22, 0x00, 0xF0, 0x64, 0xFB, 0x05, 0x98, 0x04, 0x78, 0x0B, 0x98, 0x00, 0x78, 0x0C, 0x90, 0x08, 0x98, 0xBB, 0x2C, 0x01, 0x78, 0x02, 0xD0, 0xAA, 0x2C, 0x2F, 0xD0, 0x31, 0xE0, 0x0C, 0x98, 0x01, 0x28, 0x0B, 0xD1, 0x0D, 0x98, 0x17, 0x9A, 0x10, 0x60, 0x0C, 0x54, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x0F, 0x98, 0x18, 0x9A, 0x10, 0x60, 0x19, 0x9A, 0x11, 0x98, 0x10, 0x60, 0x47, 0x4A, 0x15, 0x98, 0x02, 0x60, 0x0C, 0x98, 0x02, 0x28, 0x0B, 0xD1, 0x0E, 0x98, 0x17, 0x9A, 0x10, 0x60, 0x10, 0x98, 0x18, 0x9A, 0x10, 0x60, 0x19, 0x9A, 0x12, 0x98, 0x10, 0x60, 0x41, 0x4A, 0x15, 0x98, 0x02, 0x60, 0xCC, 0x20, 0x0F, 0xE0, 0x08, 0x99, 0x09, 0x78, 0x0C, 0xE0, 0x02, 0x20, 0x00, 0xE0, 0x01, 0x20, 0x0B, 0x99, 0x08, 0x70, 0x1A, 0x99, 0x0B, 0x80, 0x13, 0x99, 0x00, 0x20, 0x08, 0x80, 0x08, 0x98, 0x01, 0x78, 0xBB, 0x20, 0x05, 0x9A, 0x10, 0x70, 0x06, 0x29, 0x07, 0x99, 0x11, 0xD1, 0x06, 0x20, 0x08, 0x60, 0x20, 0x98 ,
0x00, 0x25, 0x05, 0x70, 0x21, 0x98, 0x29, 0x46, 0x04, 0x22, 0xFB, 0xF7, 0x27, 0xFB, 0x01, 0x20, 0x00, 0xF0, 0x3A, 0xFA, 0x02, 0x20, 0x00, 0xF0, 0x37, 0xFA, 0x22, 0x98, 0x05, 0x60, 0x07, 0x98, 0x04, 0x99, 0x00, 0x68, 0x07, 0x28, 0x44, 0xD1, 0x09, 0x78, 0x03, 0x9C, 0x80, 0x29, 0x40, 0xD1, 0x38, 0x34, 0x21, 0x78, 0x64, 0x1C, 0x22, 0x46, 0x00, 0x29, 0x3A, 0xD1, 0x20, 0x98, 0x90, 0xF8, 0x00, 0xA0, 0x22, 0x98, 0x05, 0x90, 0xD0, 0xF8, 0x00, 0x90, 0x51, 0x46, 0x48, 0x46, 0xFD, 0xF7, 0x79, 0xF9, 0x5F, 0xFA, 0x80, 0xF8, 0x21, 0x9F, 0x15, 0x78, 0x51, 0x46, 0x48, 0x46, 0x17, 0xF8, 0x08, 0x30, 0xFD, 0xF7, 0xD4, 0x54, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x6F, 0xF9, 0x1E, 0x46, 0x1B, 0x1D, 0xC0, 0xB2, 0x38, 0x5C, 0x00, 0x1D, 0xA8, 0x42, 0x28, 0x46, 0x07, 0xDD, 0x80, 0x18, 0x82, 0x1C, 0x10, 0x78, 0x2D, 0x18, 0xAD, 0x1C, 0xAD, 0xB2, 0xAB, 0x42, 0xF7, 0xDC, 0x04, 0xF8, 0x01, 0x6B, 0x11, 0x49, 0x32, 0x46 ,
0x20, 0x46, 0x01, 0xEB, 0x48, 0x11, 0xFA, 0xF7, 0xDC, 0xF9, 0xAD, 0x1B, 0xFF, 0x20, 0x34, 0x19, 0xAD, 0x1E, 0x04, 0xF8, 0x01, 0x0B, 0x25, 0x70, 0x05, 0x98, 0x01, 0x68, 0x49, 0x1C, 0x01, 0x60, 0x07, 0x98, 0x00, 0x68, 0x07, 0x28, 0x04, 0xD0, 0x06, 0x99, 0x08, 0x68, 0x20, 0xF4, 0x80, 0x30, 0x08, 0x60, 0x23, 0xB0, 0xBD, 0xE8, 0xF0, 0x8F, 0xC0, 0x46, 0x94, 0x57, 0x02, 0x00, 0xD4, 0x57, 0x02, 0x00, 0x5C, 0x58, 0x02, 0x00, 0x6E, 0x48, 0x2D, 0xE9, 0xF0, 0x47, 0x6E, 0x4D, 0x82, 0x89, 0x4A, 0xF6, 0x55, 0x21, 0xAD, 0xF5, 0xFE, 0x7D, 0x91, 0x42, 0x4F, 0xF0, 0x00, 0x01, 0xAD, 0xF1, 0x38, 0x0D, 0x12, 0xD1, 0x29, 0x60, 0x68, 0x4A, 0x11, 0x70, 0x41, 0xF2, 0x10, 0x41, 0x81, 0x81, 0x4F, 0xF6, 0xFF, 0x70, 0x66, 0x49, 0x08, 0x60, 0x28, 0x68, 0x00, 0x90, 0x02, 0x22, 0x05, 0x21, 0x03, 0x20, 0x41, 0xF2, 0x34, 0x23, 0xF3, 0xF7, 0x48, 0xF8, 0x29, 0x68, 0x61, 0x4C, 0x01, 0x29, 0x20, 0x68, 0x40, 0xF0, 0xAF, 0x80 ,
0x5F, 0x4D, 0x02, 0x28, 0x29, 0x68, 0x23, 0xD1, 0x9C, 0x55, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x5E, 0x48, 0x00, 0x68, 0x5F, 0x4A, 0x12, 0x5C, 0x00, 0x92, 0x01, 0x91, 0x5E, 0x49, 0x09, 0x68, 0x02, 0x91, 0x5B, 0x49, 0x0B, 0x5C, 0x03, 0x20, 0x07, 0x21, 0x04, 0x22, 0xF3, 0xF7, 0x2E, 0xF8, 0x5B, 0x49, 0x4A, 0x79, 0x59, 0x48, 0x00, 0x92, 0x02, 0x79, 0x01, 0x92, 0x40, 0x79, 0x04, 0x22, 0x02, 0x90, 0x03, 0x20, 0x0B, 0x79, 0x07, 0x21, 0xF3, 0xF7, 0x20, 0xF8, 0x03, 0x20, 0x20, 0x60, 0xEC, 0xF7, 0x1A, 0xFF, 0x20, 0x68, 0x29, 0x68, 0x04, 0x28, 0x15, 0xD1, 0x0D, 0x20, 0x8D, 0xF8, 0x10, 0x00, 0x00, 0x25, 0x8D, 0xF8, 0x14, 0x50, 0x8D, 0xF8, 0x15, 0x10, 0x28, 0x46, 0x63, 0x21, 0x00, 0xF0, 0xAA, 0xFB, 0x63, 0x21, 0x28, 0x46, 0x00, 0xF0, 0xFA, 0xFA, 0x03, 0xA9, 0x04, 0xA8, 0xE0, 0xF7, 0xCA, 0xFC, 0x05, 0x20, 0x20, 0x60, 0x46, 0x4D, 0x05, 0x28, 0x29, 0x68, 0x01, 0xF1, 0x01, 0x01, 0x29, 0x60, 0x1D, 0xD1 ,
0x44, 0x4A, 0x8A, 0x42, 0x1A, 0xD1, 0x43, 0x48, 0x01, 0x68, 0x00, 0x91, 0x40, 0x68, 0x01, 0x90, 0x03, 0x20, 0x02, 0x46, 0x06, 0x21, 0x41, 0x4E, 0x33, 0x46, 0x22, 0x3B, 0xF2, 0xF7, 0xEB, 0xFF, 0x3E, 0x48, 0x01, 0x68, 0x00, 0x91, 0x40, 0x68, 0x33, 0x46, 0x06, 0x21, 0x01, 0x90, 0x03, 0x20, 0x02, 0x46, 0xF2, 0xF7, 0xE0, 0xFF, 0x00, 0x20, 0x28, 0x60, 0x20, 0x68, 0x06, 0x28, 0x47, 0xD1, 0x4F, 0xF0, 0x64, 0x56, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x07, 0x0A, 0xC4, 0xF8, 0x00, 0xA0, 0x03, 0x20, 0x48, 0xF2, 0x70, 0x53, 0x01, 0x22, 0x04, 0x21, 0xF2, 0xF7, 0xD0, 0xFF, 0xDF, 0xF8, 0xCC, 0x80, 0x31, 0x4F, 0x48, 0xF2, 0x70, 0x59, 0x01, 0x25, 0x49, 0xEA, 0x05, 0x03, 0x01, 0x22, 0x04, 0x21, 0x03, 0x20, 0xF2, 0xF7, 0xC3, 0xFF, 0x00, 0x24, 0x17, 0xF8, 0x02, 0x0F, 0x20, 0xE0, 0x69, 0x01, 0x04, 0xEB, 0x08, 0x02, 0x88, 0x18, 0xC6, 0x1C, 0x43, 0x78, 0x00, 0x93, 0x80, 0x78, 0x01, 0x90, 0x30, 0x78, 0x02, 0x90 ,
0x53, 0x5C, 0x51, 0x46, 0x04, 0x22, 0x03, 0x20, 0xF2, 0xF7, 0xAE, 0xFF, 0x38, 0x78, 0x01, 0x1B, 0xB1, 0xF1, 0xFF, 0x3F, 0x08, 0xD1, 0xF0, 0x78, 0x00, 0x90, 0xB3, 0x78, 0x03, 0x20, 0x02, 0x22, 0x05, 0x21, 0xF2, 0xF7, 0xA1, 0xFF, 0x38, 0x78, 0x24, 0x1D, 0xE4, 0xB2, 0xA0, 0x42, 0xDC, 0xDC, 0xAD, 0x1C, 0xED, 0xB2, 0x04, 0x2D, 0xCD, 0xDB, 0x63, 0x21, 0x4F, 0xF4, 0x05, 0x70, 0xF1, 0xF7, 0xA3, 0xFC, 0xE1, 0xF7, 0x85, 0xFD, 0x7F, 0xB0, 0x0E, 0xB0, 0xBD, 0xE8, 0xF0, 0x87, 0xC0, 0x46, 0x04, 0x74, 0x00, 0x20, 0x50, 0x57, 0x02, 0x00, 0x6C, 0x5D, 0x02, 0x00, 0x40, 0x00, 0x3D, 0x80, 0x4C, 0x57, 0x02, 0x00, 0x58, 0x57, 0x02, 0x00, 0x90, 0x57, 0x02, 0x00, 0x60, 0x57, 0x02, 0x00, 0x70, 0x57, 0x02, 0x00, 0x5C, 0x57, 0x02, 0x00, 0x80, 0x57, 0x02, 0x00, 0x2C, 0x57, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x88, 0x57, 0x02, 0x00, 0x54, 0x57, 0x02, 0x00, 0xFF, 0xFF, 0x03, 0x00, 0x38, 0x58, 0x02, 0x00, 0x40, 0x58 ,
0x02, 0x00, 0x66, 0x55, 0xDD, 0xEE, 0xDB, 0x58, 0x02, 0x00, 0x5C, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x57, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBC, 0x58, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2D, 0xE9, 0xFE, 0x4F, 0x4A, 0x4A, 0x49, 0x4D, 0x00, 0x90, 0xB2, 0xF9, 0x00, 0x20, 0x43, 0xA3, 0x29, 0x78, 0x01, 0x93, 0x43, 0xA3, 0x01, 0x28, 0x02, 0x93, 0x47, 0x4E, 0xDF, 0xF8, 0x1C, 0x81, 0xDF, 0xF8, 0x1C, 0x91, 0x1E, 0xD0, 0x43, 0x48, 0x04, 0x78, 0x48, 0x01, 0x87, 0x19, 0x30, 0x18, 0x01, 0x99, 0x06, 0x22, 0xF9, 0xF7, 0xC8, 0xFF, 0x40, 0x46, 0x01, 0x78, 0x00, 0x68, 0x07, 0xF1, 0x06, 0x07, 0x07, 0xF8, 0x01, 0x1B, 0x07, 0xF8, 0x01, 0x4B, 0x4F, 0xF0, 0x00, 0x01, 0x07, 0xF8, 0x01, 0x1B, 0x20, 0xB9, 0x39, 0x70, 0x28, 0x78, 0x4E, 0x46, 0x0A, 0x21, 0x58, 0xE0, 0xDF, 0xF8, 0xE4, 0xB0, 0x0F, 0xE0, 0xD4, 0xB2, 0x48, 0x01, 0x87, 0x19, 0x30, 0x18, 0x02, 0x99, 0x07, 0x22, 0xF9, 0xF7, 0xAA, 0xFF, 0xFF, 0x1D, 0x00, 0x20, 0xDF, 0xF8, 0xCC, 0xB0, 0x07, 0xF8, 0x01, 0x4B, 0x07, 0xF8, 0x01, 0x0B, 0x16, 0x2C, 0xB2, 0x46, 0xAE, 0xBF, 0x14, 0x20, 0x84, 0x59 ,
0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x60, 0x1E, 0xC0, 0xB2, 0x38, 0x70, 0x4E, 0x46, 0x7F, 0x1C, 0x40, 0x1C, 0xC2, 0xB2, 0x28, 0x78, 0x5B, 0x46, 0x00, 0x21, 0x32, 0x54, 0x38, 0x46, 0x00, 0xF0, 0xBC, 0xF9, 0x28, 0x78, 0x16, 0x2C, 0x31, 0x5C, 0x01, 0xF1, 0x0A, 0x01, 0x31, 0x54, 0x00, 0xF1, 0x01, 0x00, 0xC0, 0xB2, 0x28, 0x70, 0x2B, 0xDB, 0x00, 0x99, 0x0A, 0xEB, 0x40, 0x10, 0x07, 0x46, 0x01, 0x29, 0xA4, 0xF1, 0x01, 0x09, 0x09, 0xD0, 0x01, 0x99, 0x06, 0x22, 0xF9, 0xF7, 0x79, 0xFF, 0x40, 0x46, 0x00, 0x78, 0xBF, 0x1D, 0x07, 0xF8, 0x01, 0x0B, 0x04, 0xE0, 0x02, 0x99, 0x07, 0x22, 0xF9, 0xF7, 0x6F, 0xFF, 0xFF, 0x1D, 0x07, 0xF8, 0x01, 0x4B, 0x15, 0x3C, 0x15, 0x21, 0x28, 0x78, 0xE2, 0xB2, 0x5B, 0x46, 0x07, 0xF8, 0x01, 0x1B, 0x32, 0x54, 0x07, 0xF8, 0x01, 0x9B, 0x38, 0x46, 0x00, 0xF0, 0x8B, 0xF9, 0x28, 0x78, 0x31, 0x5C, 0x0A, 0x31, 0x31, 0x54, 0x40, 0x1C, 0x28, 0x70, 0xBD, 0xE8, 0xFE, 0x8F, 0xC0, 0x46 ,
0x54, 0x54, 0x54, 0x4B, 0x45, 0x59, 0x00, 0xC0, 0x54, 0x54, 0x54, 0x53, 0x53, 0x49, 0x44, 0x00, 0x54, 0x58, 0x02, 0x00, 0xE6, 0x58, 0x02, 0x00, 0xE8, 0x58, 0x02, 0x00, 0x5C, 0x58, 0x02, 0x00, 0x5C, 0x57, 0x02, 0x00, 0xDC, 0x58, 0x02, 0x00, 0xD4, 0x57, 0x02, 0x00, 0x94, 0x57, 0x02, 0x00, 0xFF, 0xB5, 0x0C, 0x46, 0x06, 0x46, 0xF7, 0xF7, 0x4C, 0x5A, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0xE3, 0xFE, 0x15, 0x49, 0x15, 0x4A, 0x0D, 0x68, 0x01, 0xA9, 0x92, 0xE8, 0x8C, 0x00, 0x81, 0xE8, 0x8C, 0x00, 0xF7, 0xF7, 0xFD, 0xFE, 0x01, 0x98, 0x11, 0x49, 0x28, 0x1A, 0x03, 0x9D, 0x25, 0x60, 0x02, 0x9A, 0x80, 0x18, 0x82, 0x42, 0x30, 0x60, 0x0E, 0xD8, 0x08, 0x46, 0x00, 0x68, 0x22, 0x68, 0x82, 0x42, 0x0E, 0xD2, 0x68, 0x46, 0xE8, 0xF7, 0xB9, 0xFF, 0x9D, 0xF8, 0x00, 0x00, 0x05, 0xF1, 0x01, 0x05, 0x30, 0xB9, 0x03, 0x95, 0x03, 0xE0, 0x25, 0x68, 0x6D, 0x1C, 0x25, 0x60, 0x0C, 0x46, 0x25, 0x60, 0x00, 0x20, 0x00, 0x90 ,
0xFF, 0xBD, 0x60, 0x55, 0x30, 0x80, 0x24, 0x5D, 0x00, 0x20, 0x6C, 0x5D, 0x02, 0x00, 0x70, 0xB5, 0x4D, 0x00, 0x20, 0x2D, 0x4F, 0xF0, 0x00, 0x01, 0x0C, 0x46, 0x4F, 0xEA, 0x55, 0x13, 0x09, 0xD3, 0x50, 0xF8, 0x21, 0x60, 0xB6, 0xF1, 0xFF, 0x3F, 0x04, 0xD1, 0x49, 0x1C, 0xC9, 0xB2, 0x20, 0x3D, 0x5B, 0x1E, 0xF5, 0xD1, 0x4D, 0xB1, 0x20, 0x2D, 0x09, 0xD2, 0x01, 0x23, 0xAB, 0x40, 0x5B, 0x1E, 0x50, 0xF8, 0x21, 0x00, 0x18, 0x40, 0x83, 0x42, 0x01, 0xD1, 0x4F, 0xF0, 0x01, 0x04, 0x07, 0x48, 0x03, 0x78, 0x2C, 0xB9, 0x01, 0x21, 0x91, 0x40, 0xC9, 0x43, 0xC9, 0xB2, 0x0B, 0x40, 0x03, 0xE0, 0x01, 0x21, 0x91, 0x40, 0xC9, 0xB2, 0x0B, 0x43, 0x03, 0x70, 0x70, 0xBD, 0xC0, 0x46, 0xEE, 0x58, 0x02, 0x00, 0x14, 0x5B, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x7E, 0xB5, 0x05, 0x46, 0x95, 0xF8, 0x36, 0x20, 0x0E, 0x46, 0x0F, 0x49, 0x07, 0x2A, 0x12, 0xBF, 0x08, 0x68, 0x01, 0x20, 0x08, 0x60, 0x0D, 0x4C, 0x00, 0x92, 0x21, 0x68 ,
0x41, 0xF2, 0x12, 0x13, 0x04, 0x22, 0x01, 0x91, 0x07, 0x21, 0x02, 0x90, 0x03, 0x20, 0xF2, 0xF7, 0x6B, 0xFD, 0x31, 0x46, 0x28, 0x46, 0xE7, 0xF7, 0x21, 0xFC, 0x21, 0x68, 0x00, 0x22, 0x05, 0x29, 0x02, 0xD1, 0x04, 0x49, 0x08, 0x31, 0x0A, 0x60, 0x7E, 0xBD, 0xC0, 0x46, 0x50, 0x57, 0x02, 0x00, 0x4C, 0x57, 0x02, 0x00, 0x00, 0x7C, 0x00, 0x20, 0x0E, 0x49, 0x09, 0x68, 0x49, 0x08, 0x15, 0xD2, 0x0D, 0x49, 0x09, 0x78, 0x91, 0xB1, 0x44, 0xF2, 0xE9, 0x21, 0x68, 0xB9, 0x0B, 0x48, 0x01, 0x78, 0x07, 0x48, 0x01, 0x29, 0x03, 0xD1, 0x0A, 0x49, 0x09, 0x78, 0x0E, 0x29, 0x02, 0xD0, 0x44, 0xF2, 0xDE, 0x21, 0x41, 0x60, 0x01, 0x21, 0x00, 0xE0, 0x06, 0x48, 0x01, 0x60, 0x70, 0x47, 0xC0, 0x46, 0x00, 0x97, 0x3C, 0x80, 0x10, 0x0C, 0x30, 0x80, 0xDD, 0x6A, 0x00, 0x20, 0xE0, 0x7C, 0x00, 0x20, 0xA6, 0x64, 0x00, 0x20, 0x04, 0x97, 0x3C, 0x80, 0x00, 0xB5, 0xAD, 0xF1, 0x18, 0x0D, 0x4F, 0xF0, 0x09, 0x00, 0x00, 0x90, 0x4F, 0xF4 ,
0x0C, 0x60, 0x03, 0x90, 0x4F, 0xF0, 0x00, 0x00, 0x01, 0x90, 0x02, 0x90, 0x08, 0x48, 0x08, 0x49, 0x05, 0x90, 0x08, 0x68, 0x20, 0xB9, 0xDC, 0x5B, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x68, 0x46, 0x03, 0x22, 0xED, 0xF7, 0x3A, 0xFA, 0x03, 0xE0, 0x68, 0x46, 0x03, 0x22, 0xED, 0xF7, 0xC1, 0xFC, 0x06, 0xB0, 0x00, 0xBD, 0xC0, 0x46, 0x81, 0x5C, 0x02, 0x00, 0xDC, 0x7C, 0x00, 0x20, 0x1C, 0xB5, 0x0F, 0x4C, 0x22, 0x68, 0x01, 0x2A, 0x15, 0xD1, 0x0C, 0x48, 0x00, 0x68, 0x07, 0x28, 0x14, 0xBF, 0x40, 0x20, 0x4F, 0xF4, 0x05, 0x70, 0x63, 0x21, 0xF1, 0xF7, 0x0F, 0xFA, 0x20, 0x68, 0x00, 0x90, 0x43, 0xF2, 0x33, 0x33, 0x06, 0x21, 0x40, 0x20, 0x01, 0x90, 0x03, 0x20, 0x02, 0x46, 0xF2, 0xF7, 0xF4, 0xFC, 0x1C, 0xBD, 0xF1, 0xF7, 0x01, 0xFA, 0x1C, 0xBD, 0x4C, 0x57, 0x02, 0x00, 0x50, 0x57, 0x02, 0x00, 0x1E, 0xB5, 0x04, 0x46, 0x0A, 0x49, 0x00, 0x20, 0x0A, 0x4A, 0x08, 0x60, 0x0A, 0x49, 0x00, 0x90, 0x01, 0x90, 0x11, 0x60 ,
0x09, 0x4A, 0x45, 0xF2, 0x55, 0x53, 0x02, 0x91, 0x10, 0x60, 0x07, 0x21, 0x04, 0x22, 0x03, 0x20, 0xF2, 0xF7, 0xD8, 0xFC, 0x20, 0x46, 0xE7, 0xF7, 0x59, 0xFD, 0x1E, 0xBD, 0x50, 0x57, 0x02, 0x00, 0x04, 0x74, 0x00, 0x20, 0x34, 0x12, 0x66, 0x09, 0x4C, 0x57, 0x02, 0x00, 0x00, 0xB5, 0x0B, 0x49, 0x00, 0x20, 0x08, 0x60, 0xE0, 0x20, 0xF7, 0xF7, 0xAA, 0xFD, 0x09, 0x49, 0x09, 0x78, 0x49, 0xB1, 0x08, 0x49, 0x0A, 0x78, 0x08, 0x49, 0x00, 0x2A, 0x06, 0xBF, 0x01, 0x22, 0x09, 0x1F, 0x44, 0xF2, 0xA4, 0x5C, 0x02, 0x00, 0xC8, 0x00, 0x00, 0x00, 0xE9, 0x22, 0x0A, 0x60, 0xF7, 0xF7, 0xA1, 0xFD, 0x00, 0xBD, 0xC0, 0x46, 0xDC, 0x7C, 0x00, 0x20, 0xDD, 0x6A, 0x00, 0x20, 0xA7, 0x64, 0x00, 0x20, 0x04, 0x97, 0x3C, 0x80, 0x50, 0xB9, 0x09, 0x48, 0x00, 0x78, 0x01, 0x28, 0x06, 0xD1, 0x08, 0x48, 0x00, 0x78, 0x0E, 0x28, 0x08, 0xBF, 0x44, 0xF2, 0xCB, 0x20, 0x01, 0xD0, 0x44, 0xF2, 0xDE, 0x20, 0x04, 0x49, 0x08, 0x60, 0x01, 0x20 ,
0x41, 0xF8, 0x04, 0x0C, 0x70, 0x47, 0xE0, 0x7C, 0x00, 0x20, 0xA6, 0x64, 0x00, 0x20, 0x04, 0x97, 0x3C, 0x80, 0x30, 0xB5, 0x0D, 0x46, 0x84, 0x69, 0xDC, 0xF7, 0x97, 0xFB, 0x24, 0x1D, 0x01, 0x28, 0x04, 0xEB, 0x45, 0x01, 0x06, 0xD1, 0x89, 0x8E, 0x04, 0xEB, 0x85, 0x04, 0x11, 0xB9, 0x21, 0x69, 0x01, 0xB9, 0x00, 0x20, 0x30, 0xBD, 0x30, 0xB5, 0x05, 0x46, 0x5A, 0xB1, 0x03, 0xEB, 0x41, 0x03, 0x1C, 0x78, 0x59, 0x78, 0x41, 0xEA, 0x04, 0x11, 0x52, 0x1E, 0x03, 0xF1, 0x02, 0x03, 0x05, 0xF8, 0x01, 0x1B, 0xF5, 0xD1, 0x30, 0xBD, 0x00, 0xB5, 0x00, 0x20, 0xE7, 0xF7, 0xD6, 0xFE, 0x03, 0x48, 0x01, 0x68, 0x03, 0x29, 0x04, 0xBF, 0x04, 0x21, 0x01, 0x60, 0x00, 0xBD, 0xC0, 0x46, 0x4C, 0x57, 0x02, 0x00, 0x03, 0x4A, 0x12, 0x68, 0x01, 0x2A, 0x04, 0xBF, 0x02, 0x48, 0x63, 0x21, 0xF1, 0xF7, 0x76, 0xB9, 0x50, 0x57, 0x02, 0x00, 0x02, 0x20, 0x01, 0x00, 0x6C, 0x5D, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

View File

@ -0,0 +1,414 @@
#include <stdio.h>
#include <string.h>
#include "cc3000_common.h"
#include "nvmem.h"
#include "ccspi.h"
#include "hci.h"
#include "wlan.h"
#include "patch_prog.h"
#define BIT0 0x1
#define BIT1 0x2
#define BIT2 0x4
#define BIT3 0x8
#define BIT4 0x10
#define BIT5 0x20
#define BIT6 0x40
#define BIT7 0x80
static unsigned char ucStatus_Dr;
static unsigned char ucStatus_FW;
static unsigned char return_status = 0xFF;
static signed char mac_status = -1;
static unsigned char counter = 0;
// Array to store RM parameters from EEPROM.
static unsigned char cRMParamsFromEeprom[128];
// Array to store MAC address from EEPROM.
static unsigned char cMacFromEeprom[MAC_ADDR_LEN];
// Smart Config Prefix
static const char aucCC3000_prefix[] = {'T', 'T', 'T'};
static void systick_sleep(unsigned long ms) {
extern void HAL_Delay(volatile uint32_t Delay);
HAL_Delay(ms);
}
// 2 dim array to store address and length of new FAT
static const unsigned short aFATEntries[2][NVMEM_RM_FILEID + 1] =
/* address */ {{0x50, 0x1f0, 0x390, 0x1390, 0x2390, 0x4390, 0x6390, 0x63a0, 0x63b0, 0x63f0, 0x6430, 0x6830},
/* length */ {0x1a0, 0x1a0, 0x1000, 0x1000, 0x2000, 0x2000, 0x10, 0x10, 0x40, 0x40, 0x400, 0x200}};
/* 0. NVS */
/* 1. NVS Shadow */
/* 2. Wireless Conf */
/* 3. Wireless Conf Shadow */
/* 4. BT (WLAN driver) Patches */
/* 5. WiLink (Firmware) Patches */
/* 6. MAC addr */
/* 7. Frontend Vars */
/* 8. IP config */
/* 9. IP config Shadow */
/* 10. Bootloader Patches */
/* 11. Radio Module params */
/* 12. AES128 for smart config */
/* 13. user file */
/* 14. user file */
/* 15. user file */
//*****************************************************************************
//
//! sendDriverPatch
//!
//! \param pointer to the length
//!
//! \return none
//!
//! \brief The function returns a pointer to the driver patch:
//! since there is no patch yet - it returns 0
//
//*****************************************************************************
static char *sendDriverPatch(unsigned long *Length)
{
*Length = 0;
return NULL;
}
//*****************************************************************************
//
//! sendBootLoaderPatch
//!
//! \param pointer to the length
//!
//! \return none
//!
//! \brief The function returns a pointer to the boot loader patch:
//! since there is no patch yet - it returns 0
//
//*****************************************************************************
static char *sendBootLoaderPatch(unsigned long *Length)
{
*Length = 0;
return NULL;
}
//*****************************************************************************
//
//! sendWLFWPatch
//!
//! \param pointer to the length
//!
//! \return none
//!
//! \brief The function returns a pointer to the FW patch:
//! since there is no patch yet - it returns 0
//
//*****************************************************************************
static char *sendWLFWPatch(unsigned long *Length)
{
*Length = 0;
return NULL;
}
//*****************************************************************************
//
//! CC3000_UsynchCallback
//!
//! \param Event type
//!
//! \return none
//!
//! \brief The function handles asynchronous events that come from CC3000
//! device and operates a LED4 to have an on-board indication
//
//*****************************************************************************
static void CC3000_UsynchCallback(long lEventType, char * data, unsigned char length)
{
}
//*****************************************************************************
//
//! initDriver
//!
//! \param[in] cRequestPatch 0 to load with EEPROM patches
//! and 1 to load with no patches
//!
//! \return none
//!
//! \brief The function initializes a CC3000 device
//! and triggers it to start operation
//
//*****************************************************************************
static int initDriver(unsigned short cRequestPatch)
{
// WLAN On API Implementation
wlan_init(CC3000_UsynchCallback, sendWLFWPatch, sendDriverPatch, sendBootLoaderPatch,
ReadWlanInterruptPin, SpiResumeSpi, SpiPauseSpi, WriteWlanPin);
// Trigger a WLAN device
wlan_start(cRequestPatch);
wlan_smart_config_set_prefix((char*)aucCC3000_prefix);
wlan_ioctl_set_connection_policy(0, 0, 0);
wlan_ioctl_del_profile(255);
// Mask out all non-required events from CC3000
wlan_set_event_mask(HCI_EVNT_WLAN_KEEPALIVE|
HCI_EVNT_WLAN_UNSOL_INIT|
HCI_EVNT_WLAN_ASYNC_PING_REPORT);
//unsolicicted_events_timer_init();
systick_sleep(100);
return(0);
}
//*****************************************************************************
//
//! fat_read_content
//!
//! \param[out] is_allocated array of is_allocated in FAT table:\n
//! an allocated entry implies the address and length of the
//! file are valid.
//! 0: not allocated; 1: allocated.
//! \param[out] is_valid array of is_valid in FAT table:\n
//! a valid entry implies the content of the file is relevant.
//! 0: not valid; 1: valid.
//! \param[out] write_protected array of write_protected in FAT table:\n
//! a write protected entry implies it is not possible to write
//! into this entry.
//! 0: not protected; 1: protected.
//! \param[out] file_address array of file address in FAT table:\n
//! this is the absolute address of the file in the EEPROM.
//! \param[out] file_length array of file length in FAT table:\n
//! this is the upper limit of the file size in the EEPROM.
//!
//! \return on succes 0, error otherwise
//!
//! \brief parse the FAT table from eeprom
//
//*****************************************************************************
static unsigned char __attribute__ ((unused))
fat_read_content(unsigned char *is_allocated, unsigned char *is_valid,
unsigned char *write_protected, unsigned short *file_address, unsigned short *file_length)
{
unsigned short index;
unsigned char ucStatus;
unsigned char fatTable[48];
unsigned char* fatTablePtr = fatTable;
//
// Read in 6 parts to work with tiny driver
//
for (index = 0; index < 6; index++)
{
ucStatus = nvmem_read(16, 8, 4 + 8*index, fatTablePtr);
fatTablePtr += 8;
}
fatTablePtr = fatTable;
for (index = 0; index <= NVMEM_RM_FILEID; index++)
{
*is_allocated++ = (*fatTablePtr) & BIT0;
*is_valid++ = ((*fatTablePtr) & BIT1) >> 1;
*write_protected++ = ((*fatTablePtr) & BIT2) >> 2;
*file_address++ = ((*(fatTablePtr+1)<<8) | (*fatTablePtr)) & (BIT4|BIT5|BIT6|BIT7);
*file_length++ = ((*(fatTablePtr+3)<<8) | (*(fatTablePtr+2))) & (BIT4|BIT5|BIT6|BIT7);
//
// Move to next file ID
//
fatTablePtr += 4;
}
return ucStatus;
}
//*****************************************************************************
//
//! fat_write_content
//!
//! \param[in] file_address array of file address in FAT table:\n
//! this is the absolute address of the file in the EEPROM.
//! \param[in] file_length array of file length in FAT table:\n
//! this is the upper limit of the file size in the EEPROM.
//!
//! \return on succes 0, error otherwise
//!
//! \brief parse the FAT table from eeprom
//
//*****************************************************************************
static unsigned char fat_write_content(unsigned short const *file_address,
unsigned short const *file_length)
{
unsigned short index = 0;
unsigned char ucStatus;
unsigned char fatTable[48];
unsigned char* fatTablePtr = fatTable;
//
// First, write the magic number.
//
ucStatus = nvmem_write(16, 2, 0, (unsigned char*)"LS");
for (; index <= NVMEM_RM_FILEID; index++)
{
//
// Write address low char and mark as allocated.
//
*fatTablePtr++ = (unsigned char)(file_address[index] & 0xff) | BIT0;
//
// Write address high char.
//
*fatTablePtr++ = (unsigned char)((file_address[index]>>8) & 0xff);
//
// Write length low char.
//
*fatTablePtr++ = (unsigned char)(file_length[index] & 0xff);
//
// Write length high char.
//
*fatTablePtr++ = (unsigned char)((file_length[index]>>8) & 0xff);
}
//
// Second, write the FAT.
// Write in two parts to work with tiny driver.
//
ucStatus = nvmem_write(16, 24, 4, fatTable);
ucStatus = nvmem_write(16, 24, 24+4, &fatTable[24]);
//
// Third, we want to erase any user files.
//
memset(fatTable, 0, sizeof(fatTable));
ucStatus = nvmem_write(16, 16, 52, fatTable);
return ucStatus;
}
void patch_prog_start()
{
unsigned short index;
unsigned char *pRMParams;
printf("Initializing module...\n");
// Init module and request to load with no patches.
// This is in order to overwrite restrictions to
// write to specific places in EEPROM.
initDriver(1);
// Read MAC address.
mac_status = nvmem_get_mac_address(cMacFromEeprom);
return_status = 1;
printf("Reading RM parameters...\n");
while ((return_status) && (counter < 3)) {
// Read RM parameters.
// Read in 16 parts to work with tiny driver.
return_status = 0;
pRMParams = cRMParamsFromEeprom;
for (index = 0; index < 16; index++) {
return_status |= nvmem_read(NVMEM_RM_FILEID, 8, 8*index, pRMParams);
pRMParams += 8;
}
counter++;
}
// If RM file is not valid, load the default one.
if (counter == 3) {
printf("RM is not valid, loading default one...\n");
pRMParams = (unsigned char *)cRMdefaultParams;
} else {
printf("RM is valid.\n");
pRMParams = cRMParamsFromEeprom;
}
return_status = 1;
printf("Writing new FAT\n");
while (return_status) {
// Write new FAT.
return_status = fat_write_content(aFATEntries[0], aFATEntries[1]);
}
return_status = 1;
printf("Writing RM parameters...\n");
while (return_status) {
// Write RM parameters.
// Write in 4 parts to work with tiny driver.
return_status = 0;
for (index = 0; index < 4; index++) {
return_status |= nvmem_write(NVMEM_RM_FILEID,
32,
32*index,
(pRMParams + 32*index));
}
}
return_status = 1;
// Write back the MAC address, only if exists.
if (mac_status == 0) {
// Zero out MCAST bit if set.
cMacFromEeprom[0] &= 0xfe;
printf("Writing back MAC address..\n");
while (return_status) {
return_status = nvmem_set_mac_address(cMacFromEeprom);
}
}
// Update driver
ucStatus_Dr = 1;
printf("Updating driver patch...\n");
while (ucStatus_Dr) {
// Writing driver patch to EEPRROM - PROTABLE CODE
// Note that the array itself is changing between the
// different Service Packs.
ucStatus_Dr = nvmem_write_patch(NVMEM_WLAN_DRIVER_SP_FILEID,
drv_length,
wlan_drv_patch);
}
// Update firmware
ucStatus_FW = 1;
printf("Updating firmware patch...\n");
while (ucStatus_FW) {
// Writing FW patch to EEPRROM - PROTABLE CODE
// Note that the array itself is changing between the
// different Service Packs.
ucStatus_FW = nvmem_write_patch(NVMEM_WLAN_FW_SP_FILEID,
fw_length,
fw_patch);
}
printf("Update complete, resetting module\n"\
"If this doesn't work, reset manually...\n");
wlan_stop();
systick_sleep(500);
// Re-Init module and request to load with patches.
initDriver(0);
// If MAC does not exist, it is recommended
// that the user will write a valid mac address.
if (mac_status != 0) {
printf("MAC address is not valid, please write a new one\n");
}
// Patch update done
printf("All done, call wlan.patch_version()\n");
}

View File

@ -40,16 +40,11 @@
//
//*****************************************************************************
#include <stdint.h>
#include "mpconfigport.h"
#if MICROPY_HW_ENABLE_CC3K
#include "security.h"
#ifndef CC3000_UNENCRYPTED_SMART_CONFIG
// foreward sbox
const unsigned char sbox[256] = {
const UINT8 sbox[256] = {
//0 1 2 3 4 5 6 7 8 9 A B C D E F
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, //0
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, //1
@ -68,7 +63,7 @@ const unsigned char sbox[256] = {
0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, //E
0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 }; //F
// inverse sbox
const unsigned char rsbox[256] =
const UINT8 rsbox[256] =
{ 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb
, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb
, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e
@ -86,11 +81,11 @@ const unsigned char rsbox[256] =
, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61
, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d };
// round constant
const unsigned char Rcon[11] = {
const UINT8 Rcon[11] = {
0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36};
unsigned char expandedKey[176];
UINT8 expandedKey[176];
//*****************************************************************************
//
@ -105,10 +100,9 @@ unsigned char expandedKey[176];
//!
//*****************************************************************************
void expandKey(unsigned char *expandedKey,
unsigned char *key)
void expandKey(UINT8 *expandedKey, UINT8 *key)
{
unsigned short ii, buf1;
UINT16 ii, buf1;
for (ii=0;ii<16;ii++)
expandedKey[ii] = key[ii];
for (ii=1;ii<11;ii++){
@ -145,7 +139,7 @@ void expandKey(unsigned char *expandedKey,
//!
//*****************************************************************************
unsigned char galois_mul2(unsigned char value)
UINT8 galois_mul2(UINT8 value)
{
if (value>>7)
{
@ -179,9 +173,9 @@ unsigned char galois_mul2(unsigned char value)
//!
//*****************************************************************************
void aes_encr(unsigned char *state, unsigned char *expandedKey)
void aes_encr(UINT8 *state, UINT8 *expandedKey)
{
unsigned char buf1, buf2, buf3, round;
UINT8 buf1, buf2, buf3, round;
for (round = 0; round < 9; round ++){
// addroundkey, sbox and shiftrows
@ -306,10 +300,10 @@ void aes_encr(unsigned char *state, unsigned char *expandedKey)
//!
//*****************************************************************************
void aes_decr(unsigned char *state, unsigned char *expandedKey)
void aes_decr(UINT8 *state, UINT8 *expandedKey)
{
unsigned char buf1, buf2, buf3;
signed char round;
UINT8 buf1, buf2, buf3;
INT8 round;
round = 9;
// initial addroundkey
@ -449,8 +443,7 @@ void aes_decr(unsigned char *state, unsigned char *expandedKey)
//!
//*****************************************************************************
void aes_encrypt(unsigned char *state,
unsigned char *key)
void aes_encrypt(UINT8 *state, UINT8 *key)
{
// expand the key into 176 bytes
expandKey(expandedKey, key);
@ -474,8 +467,7 @@ void aes_encrypt(unsigned char *state,
//!
//*****************************************************************************
void aes_decrypt(unsigned char *state,
unsigned char *key)
void aes_decrypt(UINT8 *state, UINT8 *key)
{
expandKey(expandedKey, key); // expand the key into 176 bytes
aes_decr(state, expandedKey);
@ -496,9 +488,9 @@ void aes_decrypt(unsigned char *state,
//!
//*****************************************************************************
signed long aes_read_key(unsigned char *key)
INT32 aes_read_key(UINT8 *key)
{
signed long returnValue;
INT32 returnValue;
returnValue = nvmem_read(NVMEM_AES128_KEY_FILEID, AES128_KEY_SIZE, 0, key);
@ -519,9 +511,9 @@ signed long aes_read_key(unsigned char *key)
//!
//*****************************************************************************
signed long aes_write_key(unsigned char *key)
INT32 aes_write_key(UINT8 *key)
{
signed long returnValue;
INT32 returnValue;
returnValue = nvmem_write(NVMEM_AES128_KEY_FILEID, AES128_KEY_SIZE, 0, key);
@ -536,5 +528,3 @@ signed long aes_write_key(unsigned char *key)
//! @}
//
//*****************************************************************************
#endif // MICROPY_HW_ENABLE_CC3K

View File

@ -40,30 +40,26 @@
//
//*****************************************************************************
#include <stdint.h>
#include <string.h> // for memcpy
#include "mpconfigport.h"
#if MICROPY_HW_ENABLE_CC3K
#include <string.h>
#include <stdlib.h>
#include "hci.h"
#include "socket.h"
#include "evnt_handler.h"
#include "netapp.h"
extern int errno;
//Enable this flag if and only if you must comply with BSD socket
//close() function
#ifdef _API_USE_BSD_CLOSE
#define close(sd) closesocket(sd)
#define close(sd) closesocket(sd)
#endif
//Enable this flag if and only if you must comply with BSD socket read() and
//write() functions
#ifdef _API_USE_BSD_READ_WRITE
#define read(sd, buf, len, flags) recv(sd, buf, len, flags)
#define write(sd, buf, len, flags) send(sd, buf, len, flags)
#define read(sd, buf, len, flags) recv(sd, buf, len, flags)
#define write(sd, buf, len, flags) send(sd, buf, len, flags)
#endif
#define SOCKET_OPEN_PARAMS_LEN (12)
@ -79,7 +75,7 @@ extern int errno;
#define SOCKET_RECV_FROM_PARAMS_LEN (12)
#define SOCKET_SENDTO_PARAMS_LEN (24)
#define SOCKET_MDNS_ADVERTISE_PARAMS_LEN (12)
#define SOCKET_GET_MSS_VALUE_PARAMS_LEN (4)
// The legnth of arguments for the SEND command: sd + buff_offset + len + flags,
// while size of each parameter is 32 bit - so the total length is 16 bytes;
@ -112,8 +108,7 @@ extern int errno;
//! regarding the buffers available.
//
//*****************************************************************************
int
HostFlowControlConsumeBuff(int sd)
INT16 HostFlowControlConsumeBuff(INT16 sd)
{
#ifndef SEND_NON_BLOCKING
/* wait in busy loop */
@ -187,11 +182,10 @@ HostFlowControlConsumeBuff(int sd)
//
//*****************************************************************************
int
socket(long domain, long type, long protocol)
INT16 socket(INT32 domain, INT32 type, INT32 protocol)
{
long ret;
unsigned char *ptr, *args;
INT32 ret;
UINT8 *ptr, *args;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -228,11 +222,10 @@ socket(long domain, long type, long protocol)
//
//*****************************************************************************
long
closesocket(long sd)
INT32 closesocket(INT32 sd)
{
long ret;
unsigned char *ptr, *args;
INT32 ret;
UINT8 *ptr, *args;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -242,7 +235,8 @@ closesocket(long sd)
args = UINT32_TO_STREAM(args, sd);
// Initiate a HCI command
hci_command_send(HCI_CMND_CLOSE_SOCKET, ptr, SOCKET_CLOSE_PARAMS_LEN);
hci_command_send(HCI_CMND_CLOSE_SOCKET,
ptr, SOCKET_CLOSE_PARAMS_LEN);
// Since we are in blocking state - wait for event complete
SimpleLinkWaitEvent(HCI_CMND_CLOSE_SOCKET, &ret);
@ -300,15 +294,13 @@ closesocket(long sd)
//
//*****************************************************************************
long
accept(long sd, sockaddr *addr, socklen_t *addrlen)
INT32 accept(INT32 sd, sockaddr *addr, socklen_t *addrlen)
{
long ret;
unsigned char *ptr, *args;
INT32 ret;
UINT8 *ptr, *args;
tBsdReturnParams tAcceptReturnArguments;
ret = EFAIL;
tAcceptReturnArguments.iStatus = EFAIL; // in case of timeout
ptr = tSLInformation.pucTxCommandBuffer;
args = (ptr + HEADERS_SIZE_CMD);
@ -365,11 +357,10 @@ accept(long sd, sockaddr *addr, socklen_t *addrlen)
//
//*****************************************************************************
long
bind(long sd, const sockaddr *addr, long addrlen)
INT32 bind(INT32 sd, const sockaddr *addr, INT32 addrlen)
{
long ret;
unsigned char *ptr, *args;
INT32 ret;
UINT8 *ptr, *args;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -381,7 +372,7 @@ bind(long sd, const sockaddr *addr, long addrlen)
args = UINT32_TO_STREAM(args, sd);
args = UINT32_TO_STREAM(args, 0x00000008);
args = UINT32_TO_STREAM(args, addrlen);
ARRAY_TO_STREAM(args, ((unsigned char *)addr), addrlen);
ARRAY_TO_STREAM(args, ((UINT8 *)addr), addrlen);
// Initiate a HCI command
hci_command_send(HCI_CMND_BIND,
@ -418,11 +409,10 @@ bind(long sd, const sockaddr *addr, long addrlen)
//
//*****************************************************************************
long
listen(long sd, long backlog)
INT32 listen(INT32 sd, INT32 backlog)
{
long ret;
unsigned char *ptr, *args;
INT32 ret;
UINT8 *ptr, *args;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -463,11 +453,11 @@ listen(long sd, long backlog)
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
int
gethostbyname(const char* hostname, unsigned short usNameLen, unsigned long* out_ip_addr)
INT16 gethostbyname(CHAR * hostname, UINT16 usNameLen,
UINT32* out_ip_addr)
{
tBsdGethostbynameParams ret;
unsigned char *ptr, *args;
UINT8 *ptr, *args;
errno = EFAIL;
@ -493,7 +483,7 @@ gethostbyname(const char* hostname, unsigned short usNameLen, unsigned long* out
errno = ret.retVal;
(*((long*)out_ip_addr)) = ret.outputAddress;
(*((INT32*)out_ip_addr)) = ret.outputAddress;
return (errno);
@ -529,11 +519,10 @@ gethostbyname(const char* hostname, unsigned short usNameLen, unsigned long* out
//
//*****************************************************************************
long
connect(long sd, const sockaddr *addr, long addrlen)
INT32 connect(INT32 sd, const sockaddr *addr, INT32 addrlen)
{
long int ret;
unsigned char *ptr, *args;
INT32 ret;
UINT8 *ptr, *args;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -544,7 +533,7 @@ connect(long sd, const sockaddr *addr, long addrlen)
args = UINT32_TO_STREAM(args, sd);
args = UINT32_TO_STREAM(args, 0x00000008);
args = UINT32_TO_STREAM(args, addrlen);
ARRAY_TO_STREAM(args, ((unsigned char *)addr), addrlen);
ARRAY_TO_STREAM(args, ((UINT8 *)addr), addrlen);
// Initiate a HCI command
hci_command_send(HCI_CMND_CONNECT,
@ -555,7 +544,7 @@ connect(long sd, const sockaddr *addr, long addrlen)
errno = ret;
return((long)ret);
return((INT32)ret);
}
@ -597,13 +586,12 @@ connect(long sd, const sockaddr *addr, long addrlen)
//
//*****************************************************************************
int
select(long nfds, fd_set *readsds, fd_set *writesds, fd_set *exceptsds,
struct timeval *timeout)
INT16 select(INT32 nfds, fd_set *readsds, fd_set *writesds, fd_set *exceptsds,
struct timeval *timeout)
{
unsigned char *ptr, *args;
UINT8 *ptr, *args;
tBsdSelectRecvParams tParams;
unsigned long is_blocking;
UINT32 is_blocking;
if( timeout == NULL)
{
@ -625,9 +613,9 @@ select(long nfds, fd_set *readsds, fd_set *writesds, fd_set *exceptsds,
args = UINT32_TO_STREAM(args, 0x00000014);
args = UINT32_TO_STREAM(args, 0x00000014);
args = UINT32_TO_STREAM(args, is_blocking);
args = UINT32_TO_STREAM(args, ((readsds) ? *(unsigned long*)readsds : 0));
args = UINT32_TO_STREAM(args, ((writesds) ? *(unsigned long*)writesds : 0));
args = UINT32_TO_STREAM(args, ((exceptsds) ? *(unsigned long*)exceptsds : 0));
args = UINT32_TO_STREAM(args, ((readsds) ? *(UINT32*)readsds : 0));
args = UINT32_TO_STREAM(args, ((writesds) ? *(UINT32*)writesds : 0));
args = UINT32_TO_STREAM(args, ((exceptsds) ? *(UINT32*)exceptsds : 0));
if (timeout)
{
@ -712,7 +700,7 @@ select(long nfds, fd_set *readsds, fd_set *writesds, fd_set *exceptsds,
//! 1. SOCKOPT_RECV_TIMEOUT (optname)
//! SOCKOPT_RECV_TIMEOUT configures recv and recvfrom timeout
//! in milliseconds.
//! In that case optval should be pointer to unsigned long.
//! In that case optval should be pointer to UINT32.
//! 2. SOCKOPT_NONBLOCK (optname). sets the socket non-blocking mode on
//! or off.
//! In that case optval should be SOCK_ON or SOCK_OFF (optval).
@ -722,12 +710,11 @@ select(long nfds, fd_set *readsds, fd_set *writesds, fd_set *exceptsds,
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
int
setsockopt(long sd, long level, long optname, const void *optval,
INT16 setsockopt(INT32 sd, INT32 level, INT32 optname, const void *optval,
socklen_t optlen)
{
int ret;
unsigned char *ptr, *args;
INT32 ret;
UINT8 *ptr, *args;
ptr = tSLInformation.pucTxCommandBuffer;
args = (ptr + HEADERS_SIZE_CMD);
@ -738,7 +725,7 @@ setsockopt(long sd, long level, long optname, const void *optval,
args = UINT32_TO_STREAM(args, optname);
args = UINT32_TO_STREAM(args, 0x00000008);
args = UINT32_TO_STREAM(args, optlen);
ARRAY_TO_STREAM(args, ((unsigned char *)optval), optlen);
ARRAY_TO_STREAM(args, ((UINT8 *)optval), optlen);
// Initiate a HCI command
hci_command_send(HCI_CMND_SETSOCKOPT,
@ -797,7 +784,7 @@ setsockopt(long sd, long level, long optname, const void *optval,
//! 1. SOCKOPT_RECV_TIMEOUT (optname)
//! SOCKOPT_RECV_TIMEOUT configures recv and recvfrom timeout
//! in milliseconds.
//! In that case optval should be pointer to unsigned long.
//! In that case optval should be pointer to UINT32.
//! 2. SOCKOPT_NONBLOCK (optname). sets the socket non-blocking mode on
//! or off.
//! In that case optval should be SOCK_ON or SOCK_OFF (optval).
@ -806,10 +793,9 @@ setsockopt(long sd, long level, long optname, const void *optval,
//
//*****************************************************************************
int
getsockopt (long sd, long level, long optname, void *optval, socklen_t *optlen)
INT16 getsockopt (INT32 sd, INT32 level, INT32 optname, void *optval, socklen_t *optlen)
{
unsigned char *ptr, *args;
UINT8 *ptr, *args;
tBsdGetSockOptReturnParams tRetParams;
ptr = tSLInformation.pucTxCommandBuffer;
@ -827,7 +813,7 @@ getsockopt (long sd, long level, long optname, void *optval, socklen_t *optlen)
// Since we are in blocking state - wait for event complete
SimpleLinkWaitEvent(HCI_CMND_GETSOCKOPT, &tRetParams);
if (((signed char)tRetParams.iStatus) >= 0)
if (((INT8)tRetParams.iStatus) >= 0)
{
*optlen = 4;
memcpy(optval, tRetParams.ucOptValue, 4);
@ -861,11 +847,10 @@ getsockopt (long sd, long level, long optname, void *optval, socklen_t *optlen)
//! socket the message is received from
//
//*****************************************************************************
int
simple_link_recv(long sd, void *buf, long len, long flags, sockaddr *from,
socklen_t *fromlen, long opcode)
INT16 simple_link_recv(INT32 sd, void *buf, INT32 len, INT32 flags, sockaddr *from,
socklen_t *fromlen, INT32 opcode)
{
unsigned char *ptr, *args;
UINT8 *ptr, *args;
tBsdReadReturnParams tSocketReadEvent;
ptr = tSLInformation.pucTxCommandBuffer;
@ -887,11 +872,9 @@ simple_link_recv(long sd, void *buf, long len, long flags, sockaddr *from,
{
// Wait for the data in a synchronous way. Here we assume that the bug is
// big enough to store also parameters of receive from too....
SimpleLinkWaitData(buf, (unsigned char *)from, (unsigned char *)fromlen);
SimpleLinkWaitData(buf, (UINT8 *)from, (UINT8 *)fromlen);
}
errno = tSocketReadEvent.iNumberOfBytes;
return(tSocketReadEvent.iNumberOfBytes);
@ -919,8 +902,7 @@ simple_link_recv(long sd, void *buf, long len, long flags, sockaddr *from,
//
//*****************************************************************************
int
recv(long sd, void *buf, long len, long flags)
INT16 recv(INT32 sd, void *buf, INT32 len, INT32 flags)
{
return(simple_link_recv(sd, buf, len, flags, NULL, NULL, HCI_CMND_RECV));
}
@ -953,8 +935,7 @@ recv(long sd, void *buf, long len, long flags)
//! @Note On this version, only blocking mode is supported.
//
//*****************************************************************************
int
recvfrom(long sd, void *buf, long len, long flags, sockaddr *from,
INT16 recvfrom(INT32 sd, void *buf, INT32 len, INT32 flags, sockaddr *from,
socklen_t *fromlen)
{
return(simple_link_recv(sd, buf, len, flags, from, fromlen,
@ -981,14 +962,13 @@ recvfrom(long sd, void *buf, long len, long flags, sockaddr *from,
//! socket
//
//*****************************************************************************
int
simple_link_send(long sd, const void *buf, long len, long flags,
const sockaddr *to, long tolen, long opcode)
INT16 simple_link_send(INT32 sd, const void *buf, INT32 len, INT32 flags,
const sockaddr *to, INT32 tolen, INT32 opcode)
{
unsigned char uArgSize = 0, addrlen;
unsigned char *ptr, *pDataPtr = NULL, *args;
unsigned long addr_offset = 0;
int res;
UINT8 uArgSize=0, addrlen;
UINT8 *ptr, *pDataPtr=0, *args;
UINT32 addr_offset=0;
INT16 res;
tBsdReadReturnParams tSocketSendEvent;
// Check the bsd_arguments
@ -1044,16 +1024,16 @@ simple_link_send(long sd, const void *buf, long len, long flags,
}
// Copy the data received from user into the TX Buffer
ARRAY_TO_STREAM(pDataPtr, ((unsigned char *)buf), len);
ARRAY_TO_STREAM(pDataPtr, ((UINT8 *)buf), len);
// In case we are using SendTo, copy the to parameters
if (opcode == HCI_CMND_SENDTO)
{
ARRAY_TO_STREAM(pDataPtr, ((unsigned char *)to), tolen);
ARRAY_TO_STREAM(pDataPtr, ((UINT8 *)to), tolen);
}
// Initiate a HCI command
hci_data_send(opcode, ptr, uArgSize, len,(unsigned char*)to, tolen);
hci_data_send(opcode, ptr, uArgSize, len,(UINT8*)to, tolen);
if (opcode == HCI_CMND_SENDTO)
SimpleLinkWaitEvent(HCI_EVNT_SENDTO, &tSocketSendEvent);
@ -1086,8 +1066,7 @@ simple_link_send(long sd, const void *buf, long len, long flags,
//
//*****************************************************************************
int
send(long sd, const void *buf, long len, long flags)
INT16 send(INT32 sd, const void *buf, INT32 len, INT32 flags)
{
return(simple_link_send(sd, buf, len, flags, NULL, 0, HCI_CMND_SEND));
}
@ -1118,8 +1097,7 @@ send(long sd, const void *buf, long len, long flags)
//
//*****************************************************************************
int
sendto(long sd, const void *buf, long len, long flags, const sockaddr *to,
INT16 sendto(INT32 sd, const void *buf, INT32 len, INT32 flags, const sockaddr *to,
socklen_t tolen)
{
return(simple_link_send(sd, buf, len, flags, to, tolen, HCI_CMND_SENDTO));
@ -1132,7 +1110,7 @@ sendto(long sd, const void *buf, long len, long flags, const sockaddr *to,
//! @param[in] mdnsEnabled flag to enable/disable the mDNS feature
//! @param[in] deviceServiceName Service name as part of the published
//! canonical domain name
//! @param[in] deviceServiceNameLength Length of the service name
//! @param[in] deviceServiceNameLength Length of the service name - up to 32 chars
//!
//!
//! @return On success, zero is returned, return SOC_ERROR if socket was not
@ -1142,11 +1120,10 @@ sendto(long sd, const void *buf, long len, long flags, const sockaddr *to,
//
//*****************************************************************************
int
mdnsAdvertiser(unsigned short mdnsEnabled, char * deviceServiceName, unsigned short deviceServiceNameLength)
INT16 mdnsAdvertiser(UINT16 mdnsEnabled, CHAR * deviceServiceName, UINT16 deviceServiceNameLength)
{
int ret;
unsigned char *pTxBuffer, *pArgs;
INT8 ret;
UINT8 *pTxBuffer, *pArgs;
if (deviceServiceNameLength > MDNS_DEVICE_SERVICE_MAX_LENGTH)
{
@ -1172,4 +1149,34 @@ mdnsAdvertiser(unsigned short mdnsEnabled, char * deviceServiceName, unsigned sh
}
#endif // MICROPY_HW_ENABLE_CC3K
//*****************************************************************************
//
//! getmssvalue
//!
//! @param[in] sd socket descriptor
//!
//! @return On success, returns the MSS value of a TCP connection
//!
//! @brief Returns the MSS value of a TCP connection according to the socket descriptor
//
//*****************************************************************************
UINT16 getmssvalue (INT32 sd)
{
UINT8 *ptr, *args;
UINT16 ret;
ptr = tSLInformation.pucTxCommandBuffer;
args = (ptr + HEADERS_SIZE_CMD);
// Fill in temporary command buffer
args = UINT32_TO_STREAM(args, sd);
// Initiate a HCI command
hci_command_send(HCI_CMND_GETMSSVALUE, ptr, SOCKET_GET_MSS_VALUE_PARAMS_LEN);
// Since we are in blocking state - wait for event complete
SimpleLinkWaitEvent(HCI_EVNT_GETMSSVALUE, &ret);
return ret;
}

View File

@ -39,12 +39,8 @@
//! @{
//
//*****************************************************************************
#include <stdlib.h>
#include <stdint.h>
#include "mpconfigport.h"
#if MICROPY_HW_ENABLE_CC3K
#include <string.h>
#include "wlan.h"
#include "hci.h"
#include "ccspi.h"
@ -53,15 +49,14 @@
#include "security.h"
#include "evnt_handler.h"
extern int errno;
volatile sSimplLinkInformation tSLInformation;
#define SMART_CONFIG_PROFILE_SIZE 67 // 67 = 32 (max ssid) + 32 (max key) + 1 (SSID length) + 1 (security type) + 1 (key length)
#ifndef CC3000_UNENCRYPTED_SMART_CONFIG
unsigned char key[AES128_KEY_SIZE];
unsigned char profileArray[SMART_CONFIG_PROFILE_SIZE];
UINT8 key[AES128_KEY_SIZE];
UINT8 profileArray[SMART_CONFIG_PROFILE_SIZE];
#endif //CC3000_UNENCRYPTED_SMART_CONFIG
/* patches type */
@ -117,13 +112,13 @@ unsigned char profileArray[SMART_CONFIG_PROFILE_SIZE];
//! @brief Send HCI_CMND_SIMPLE_LINK_START to CC3000
//
//*****************************************************************************
static void SimpleLink_Init_Start(unsigned short usPatchesAvailableAtHost)
static void SimpleLink_Init_Start(UINT16 usPatchesAvailableAtHost)
{
unsigned char *ptr;
unsigned char *args;
UINT8 *ptr;
UINT8 *args;
ptr = tSLInformation.pucTxCommandBuffer;
args = (unsigned char *)(ptr + HEADERS_SIZE_CMD);
args = (UINT8 *)(ptr + HEADERS_SIZE_CMD);
UINT8_TO_STREAM(args, ((usPatchesAvailableAtHost) ? SL_PATCHES_REQUEST_FORCE_NONE : SL_PATCHES_REQUEST_DEFAULT));
@ -225,7 +220,7 @@ void wlan_init( tWlanCB sWlanCB,
void SpiReceiveHandler(void *pvBuffer)
{
tSLInformation.usEventOrDataReceived = 1;
tSLInformation.pucReceivedData = (unsigned char *)pvBuffer;
tSLInformation.pucReceivedData = (UINT8 *)pvBuffer;
hci_unsolicited_event_handler();
}
@ -257,12 +252,13 @@ void SpiReceiveHandler(void *pvBuffer)
//!
//
//*****************************************************************************
#define TIMEOUT (500000)
void
wlan_start(unsigned short usPatchesAvailableAtHost)
int wlan_start(UINT16 usPatchesAvailableAtHost)
{
unsigned long ulSpiIRQState;
UINT32 ulSpiIRQState;
UINT32 wlan_timeout;
tSLInformation.NumberOfSentPackets = 0;
tSLInformation.NumberOfReleasedPackets = 0;
@ -276,7 +272,7 @@ wlan_start(unsigned short usPatchesAvailableAtHost)
tSLInformation.pucReceivedData = 0;
// Allocate the memory for the RX/TX data transactions
tSLInformation.pucTxCommandBuffer = (unsigned char *)wlan_tx_buffer;
tSLInformation.pucTxCommandBuffer = (UINT8 *)wlan_tx_buffer;
// init spi
SpiOpen(SpiReceiveHandler);
@ -287,29 +283,41 @@ wlan_start(unsigned short usPatchesAvailableAtHost)
// Chip enable: toggle WLAN EN line
tSLInformation.WriteWlanPin( WLAN_ENABLE );
if (ulSpiIRQState)
{
wlan_timeout = TIMEOUT;
if (ulSpiIRQState) {
// wait till the IRQ line goes low
while(tSLInformation.ReadWlanInterruptPin() != 0)
while(tSLInformation.ReadWlanInterruptPin() != 0 && --wlan_timeout)
{
}
}
else
{
// wait till the IRQ line goes high and than low
while(tSLInformation.ReadWlanInterruptPin() == 0)
while(tSLInformation.ReadWlanInterruptPin() == 0 && --wlan_timeout)
{
}
while(tSLInformation.ReadWlanInterruptPin() != 0)
if (wlan_timeout == 0) {
return -1;
}
wlan_timeout = TIMEOUT;
while(tSLInformation.ReadWlanInterruptPin() != 0 && --wlan_timeout)
{
}
}
if (wlan_timeout ==0) {
return -1;
}
SimpleLink_Init_Start(usPatchesAvailableAtHost);
// Read Buffer's size and finish
hci_command_send(HCI_CMND_READ_BUFFER_SIZE, tSLInformation.pucTxCommandBuffer, 0);
SimpleLinkWaitEvent(HCI_CMND_READ_BUFFER_SIZE, 0);
return 0;
}
@ -327,8 +335,7 @@ wlan_start(unsigned short usPatchesAvailableAtHost)
//
//*****************************************************************************
void
wlan_stop(void)
void wlan_stop(void)
{
// Chip disable
tSLInformation.WriteWlanPin( WLAN_DISABLE );
@ -380,14 +387,13 @@ wlan_stop(void)
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
long
wlan_connect(unsigned long ulSecType, const char *ssid, long ssid_len,
unsigned char *bssid, unsigned char *key, long key_len)
INT32 wlan_connect(UINT32 ulSecType, CHAR *ssid, INT32 ssid_len,
UINT8 *bssid, UINT8 *key, INT32 key_len)
{
long ret;
unsigned char *ptr;
unsigned char *args;
unsigned char bssid_zero[] = {0, 0, 0, 0, 0, 0};
INT32 ret;
UINT8 *ptr;
UINT8 *args;
UINT8 bssid_zero[] = {0, 0, 0, 0, 0, 0};
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -429,13 +435,12 @@ wlan_connect(unsigned long ulSecType, const char *ssid, long ssid_len,
return(ret);
}
#else
long
wlan_connect(const char *ssid, long ssid_len)
INT32 wlan_connect(CHAR *ssid, INT32 ssid_len)
{
long ret;
unsigned char *ptr;
unsigned char *args;
unsigned char bssid_zero[] = {0, 0, 0, 0, 0, 0};
INT32 ret;
UINT8 *ptr;
UINT8 *args;
UINT8 bssid_zero[] = {0, 0, 0, 0, 0, 0};
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -477,11 +482,10 @@ wlan_connect(const char *ssid, long ssid_len)
//
//*****************************************************************************
long
wlan_disconnect()
INT32 wlan_disconnect()
{
long ret;
unsigned char *ptr;
INT32 ret;
UINT8 *ptr;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -527,18 +531,17 @@ wlan_disconnect()
//
//*****************************************************************************
long
wlan_ioctl_set_connection_policy(unsigned long should_connect_to_open_ap,
unsigned long ulShouldUseFastConnect,
unsigned long ulUseProfiles)
INT32 wlan_ioctl_set_connection_policy(UINT32 should_connect_to_open_ap,
UINT32 ulShouldUseFastConnect,
UINT32 ulUseProfiles)
{
long ret;
unsigned char *ptr;
unsigned char *args;
INT32 ret;
UINT8 *ptr;
UINT8 *args;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
args = (unsigned char *)(ptr + HEADERS_SIZE_CMD);
args = (UINT8 *)(ptr + HEADERS_SIZE_CMD);
// Fill in HCI packet structure
args = UINT32_TO_STREAM(args, should_connect_to_open_ap);
@ -588,24 +591,23 @@ wlan_ioctl_set_connection_policy(unsigned long should_connect_to_open_ap,
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
long
wlan_add_profile(unsigned long ulSecType,
unsigned char* ucSsid,
unsigned long ulSsidLen,
unsigned char *ucBssid,
unsigned long ulPriority,
unsigned long ulPairwiseCipher_Or_TxKeyLen,
unsigned long ulGroupCipher_TxKeyIndex,
unsigned long ulKeyMgmt,
unsigned char* ucPf_OrKey,
unsigned long ulPassPhraseLen)
INT32 wlan_add_profile(UINT32 ulSecType,
UINT8* ucSsid,
UINT32 ulSsidLen,
UINT8 *ucBssid,
UINT32 ulPriority,
UINT32 ulPairwiseCipher_Or_TxKeyLen,
UINT32 ulGroupCipher_TxKeyIndex,
UINT32 ulKeyMgmt,
UINT8* ucPf_OrKey,
UINT32 ulPassPhraseLen)
{
unsigned short arg_len = 0;
long ret;
unsigned char *ptr;
long i = 0;
unsigned char *args;
unsigned char bssid_zero[] = {0, 0, 0, 0, 0, 0};
UINT16 arg_len=0;
INT32 ret;
UINT8 *ptr;
INT32 i = 0;
UINT8 *args;
UINT8 bssid_zero[] = {0, 0, 0, 0, 0, 0};
ptr = tSLInformation.pucTxCommandBuffer;
args = (ptr + HEADERS_SIZE_CMD);
@ -658,7 +660,7 @@ wlan_add_profile(unsigned long ulSecType,
for(i = 0; i < 4; i++)
{
unsigned char *p = &ucPf_OrKey[i * ulPairwiseCipher_Or_TxKeyLen];
UINT8 *p = &ucPf_OrKey[i * ulPairwiseCipher_Or_TxKeyLen];
ARRAY_TO_STREAM(args, p, ulPairwiseCipher_Or_TxKeyLen);
}
@ -701,7 +703,8 @@ wlan_add_profile(unsigned long ulSecType,
}
// Initiate a HCI command
hci_command_send(HCI_CMND_WLAN_IOCTL_ADD_PROFILE, ptr, arg_len);
hci_command_send(HCI_CMND_WLAN_IOCTL_ADD_PROFILE,
ptr, arg_len);
// Wait for command complete event
SimpleLinkWaitEvent(HCI_CMND_WLAN_IOCTL_ADD_PROFILE, &ret);
@ -709,17 +712,16 @@ wlan_add_profile(unsigned long ulSecType,
return(ret);
}
#else
long
wlan_add_profile(unsigned long ulSecType,
unsigned char* ucSsid,
unsigned long ulSsidLen,
unsigned char *ucBssid,
unsigned long ulPriority,
unsigned long ulPairwiseCipher_Or_TxKeyLen,
unsigned long ulGroupCipher_TxKeyIndex,
unsigned long ulKeyMgmt,
unsigned char* ucPf_OrKey,
unsigned long ulPassPhraseLen)
INT32 wlan_add_profile(UINT32 ulSecType,
UINT8* ucSsid,
UINT32 ulSsidLen,
UINT8 *ucBssid,
UINT32 ulPriority,
UINT32 ulPairwiseCipher_Or_TxKeyLen,
UINT32 ulGroupCipher_TxKeyIndex,
UINT32 ulKeyMgmt,
UINT8* ucPf_OrKey,
UINT32 ulPassPhraseLen)
{
return -1;
}
@ -741,15 +743,14 @@ wlan_add_profile(unsigned long ulSecType,
//
//*****************************************************************************
long
wlan_ioctl_del_profile(unsigned long ulIndex)
INT32 wlan_ioctl_del_profile(UINT32 ulIndex)
{
long ret;
unsigned char *ptr;
unsigned char *args;
INT32 ret;
UINT8 *ptr;
UINT8 *args;
ptr = tSLInformation.pucTxCommandBuffer;
args = (unsigned char *)(ptr + HEADERS_SIZE_CMD);
args = (UINT8 *)(ptr + HEADERS_SIZE_CMD);
// Fill in HCI packet structure
args = UINT32_TO_STREAM(args, ulIndex);
@ -800,12 +801,11 @@ wlan_ioctl_del_profile(unsigned long ulIndex)
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
long
wlan_ioctl_get_scan_results(unsigned long ulScanTimeout,
unsigned char *ucResults)
INT32 wlan_ioctl_get_scan_results(UINT32 ulScanTimeout,
UINT8 *ucResults)
{
unsigned char *ptr;
unsigned char *args;
UINT8 *ptr;
UINT8 *args;
ptr = tSLInformation.pucTxCommandBuffer;
args = (ptr + HEADERS_SIZE_CMD);
@ -848,7 +848,7 @@ wlan_ioctl_get_scan_results(unsigned long ulScanTimeout,
//! @param uiSNRThreshold NSR threshold. Saved: yes (Default: 0)
//! @param uiDefaultTxPower probe Tx power. Saved: yes (Default: 205)
//! @param aiIntervalList pointer to array with 16 entries (16 channels)
//! each entry (unsigned long) holds timeout between periodic scan
//! each entry (UINT32) holds timeout between periodic scan
//! (connection scan) - in millisecond. Saved: yes. Default 2000ms.
//!
//! @return On success, zero is returned. On error, -1 is returned
@ -862,18 +862,17 @@ wlan_ioctl_get_scan_results(unsigned long ulScanTimeout,
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
long
wlan_ioctl_set_scan_params(unsigned long uiEnable, unsigned long uiMinDwellTime,
unsigned long uiMaxDwellTime,
unsigned long uiNumOfProbeRequests,
unsigned long uiChannelMask,long iRSSIThreshold,
unsigned long uiSNRThreshold,
unsigned long uiDefaultTxPower,
unsigned long *aiIntervalList)
INT32 wlan_ioctl_set_scan_params(UINT32 uiEnable, UINT32 uiMinDwellTime,
UINT32 uiMaxDwellTime,
UINT32 uiNumOfProbeRequests,
UINT32 uiChannelMask,INT32 iRSSIThreshold,
UINT32 uiSNRThreshold,
UINT32 uiDefaultTxPower,
UINT32 *aiIntervalList)
{
unsigned long uiRes;
unsigned char *ptr;
unsigned char *args;
UINT32 uiRes;
UINT8 *ptr;
UINT8 *args;
ptr = tSLInformation.pucTxCommandBuffer;
args = (ptr + HEADERS_SIZE_CMD);
@ -888,7 +887,7 @@ wlan_ioctl_set_scan_params(unsigned long uiEnable, unsigned long uiMinDwellTime,
args = UINT32_TO_STREAM(args, iRSSIThreshold);
args = UINT32_TO_STREAM(args, uiSNRThreshold);
args = UINT32_TO_STREAM(args, uiDefaultTxPower);
ARRAY_TO_STREAM(args, aiIntervalList, sizeof(unsigned long) *
ARRAY_TO_STREAM(args, aiIntervalList, sizeof(UINT32) *
SL_SET_SCAN_PARAMS_INTERVAL_LIST_SIZE);
// Initiate a HCI command
@ -924,12 +923,11 @@ wlan_ioctl_set_scan_params(unsigned long uiEnable, unsigned long uiMinDwellTime,
//
//*****************************************************************************
long
wlan_set_event_mask(unsigned long ulMask)
INT32 wlan_set_event_mask(UINT32 ulMask)
{
long ret;
unsigned char *ptr;
unsigned char *args;
INT32 ret;
UINT8 *ptr;
UINT8 *args;
if ((ulMask & HCI_EVNT_WLAN_TX_COMPLETE) == HCI_EVNT_WLAN_TX_COMPLETE)
@ -953,7 +951,7 @@ wlan_set_event_mask(unsigned long ulMask)
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
args = (unsigned char *)(ptr + HEADERS_SIZE_CMD);
args = (UINT8 *)(ptr + HEADERS_SIZE_CMD);
// Fill in HCI packet structure
args = UINT32_TO_STREAM(args, ulMask);
@ -982,11 +980,10 @@ wlan_set_event_mask(unsigned long ulMask)
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
long
wlan_ioctl_statusget(void)
INT32 wlan_ioctl_statusget(void)
{
long ret;
unsigned char *ptr;
INT32 ret;
UINT8 *ptr;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -1022,16 +1019,15 @@ wlan_ioctl_statusget(void)
//
//*****************************************************************************
long
wlan_smart_config_start(unsigned long algoEncryptedFlag)
INT32 wlan_smart_config_start(UINT32 algoEncryptedFlag)
{
long ret;
unsigned char *ptr;
unsigned char *args;
INT32 ret;
UINT8 *ptr;
UINT8 *args;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
args = (unsigned char *)(ptr + HEADERS_SIZE_CMD);
args = (UINT8 *)(ptr + HEADERS_SIZE_CMD);
// Fill in HCI packet structure
args = UINT32_TO_STREAM(args, algoEncryptedFlag);
@ -1060,11 +1056,10 @@ wlan_smart_config_start(unsigned long algoEncryptedFlag)
//
//*****************************************************************************
long
wlan_smart_config_stop(void)
INT32 wlan_smart_config_stop(void)
{
long ret;
unsigned char *ptr;
INT32 ret;
UINT8 *ptr;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -1094,12 +1089,11 @@ wlan_smart_config_stop(void)
//
//*****************************************************************************
long
wlan_smart_config_set_prefix(char* cNewPrefix)
INT32 wlan_smart_config_set_prefix(CHAR* cNewPrefix)
{
long ret;
unsigned char *ptr;
unsigned char *args;
INT32 ret;
UINT8 *ptr;
UINT8 *args;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
@ -1142,13 +1136,12 @@ wlan_smart_config_set_prefix(char* cNewPrefix)
#ifndef CC3000_UNENCRYPTED_SMART_CONFIG
long
wlan_smart_config_process()
INT32 wlan_smart_config_process()
{
signed long returnValue;
unsigned long ssidLen, keyLen;
unsigned char *decKeyPtr;
unsigned char *ssidPtr;
INT32 returnValue;
UINT32 ssidLen, keyLen;
UINT8 *decKeyPtr;
UINT8 *ssidPtr;
// read the key from EEPROM - fileID 12
returnValue = aes_read_key(key);
@ -1178,9 +1171,9 @@ wlan_smart_config_process()
aes_decrypt(decKeyPtr, key);
if (profileArray[profileArray[0] + 1] > 16)
aes_decrypt((unsigned char *)(decKeyPtr + 16), key);
aes_decrypt((UINT8 *)(decKeyPtr + 16), key);
if (*(unsigned char *)(decKeyPtr +31) != 0)
if (*(UINT8 *)(decKeyPtr +31) != 0)
{
if (*decKeyPtr == 31)
{
@ -1257,5 +1250,3 @@ wlan_smart_config_process()
//! @}
//
//*****************************************************************************
#endif // MICROPY_HW_ENABLE_CC3K

View File

@ -1,728 +0,0 @@
/*****************************************************************************
*
* spi.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Adapted for use with the Arduino/AVR by KTOWN (Kevin Townsend)
* & Limor Fried for Adafruit Industries
* This library works with the Adafruit CC3000 breakout
* ----> https://www.adafruit.com/products/1469
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
#include <stdint.h>
#include <string.h> // for memset
#include "mpconfigport.h"
#if MICROPY_HW_ENABLE_CC3K
#include "ccspi.h"
#include "hci.h"
#include "netapp.h"
#include "evnt_handler.h"
#include "cc3000_common.h"
#include "pybcc3k.h"
#if 0 // print debugging info
#define DEBUG_printf(args...) printf(args)
#else // don't print debugging info
#define DEBUG_printf(args...) (void)0
#endif
#define READ (3)
#define WRITE (1)
#define HI(value) (((value) & 0xFF00) >> 8)
#define LO(value) ((value) & 0x00FF)
#define HEADERS_SIZE_EVNT (SPI_HEADER_SIZE + 5)
#define SPI_HEADER_SIZE (5)
#define eSPI_STATE_POWERUP (0)
#define eSPI_STATE_INITIALIZED (1)
#define eSPI_STATE_IDLE (2)
#define eSPI_STATE_WRITE_IRQ (3)
#define eSPI_STATE_WRITE_FIRST_PORTION (4)
#define eSPI_STATE_WRITE_EOT (5)
#define eSPI_STATE_READ_IRQ (6)
#define eSPI_STATE_READ_FIRST_PORTION (7)
#define eSPI_STATE_READ_EOT (8)
// CC3000 chip select
#define CC3000_ASSERT_CS() pyb_cc3000_set_cs(0)
// CC3000 chip deselect
#define CC3000_DEASSERT_CS() pyb_cc3000_set_cs(1)
/* smartconfig flags (defined in Adafruit_CC3000.cpp) */
// extern unsigned long ulSmartConfigFinished, ulCC3000DHCP;
typedef struct
{
gcSpiHandleRx SPIRxHandler;
unsigned short usTxPacketLength;
unsigned short usRxPacketLength;
unsigned long ulSpiState;
unsigned char *pTxPacket;
unsigned char *pRxPacket;
} tSpiInformation;
tSpiInformation sSpiInformation;
/* Static buffer for 5 bytes of SPI HEADER */
//unsigned char tSpiReadHeader[] = {READ, 0, 0, 0, 0};
void SpiWriteDataSynchronous(unsigned char *data, unsigned short size);
void SpiWriteAsync(const unsigned char *data, unsigned short size);
void SpiPauseSpi(void);
void SpiResumeSpi(void);
void SSIContReadOperation(void);
void cc3k_int_poll(void);
// The magic number that resides at the end of the TX/RX buffer (1 byte after the allocated size)
// for the purpose of detection of the overrun. The location of the memory where the magic number
// resides shall never be written. In case it is written - the overrun occured and either recevie function
// or send function will stuck forever.
#define CC3000_BUFFER_MAGIC_NUMBER (0xDE)
char spi_buffer[CC3000_RX_BUFFER_SIZE];
unsigned char wlan_tx_buffer[CC3000_TX_BUFFER_SIZE];
static volatile char ccspi_is_in_irq = 0;
static volatile char ccspi_int_enabled = 0;
/* Mandatory functions are:
- SpiOpen
- SpiWrite
- SpiRead
- SpiClose
- SpiResumeSpi
- ReadWlanInterruptPin
- WlanInterruptEnable
- WlanInterruptDisable
- WriteWlanPin
*/
void SpiInit(void)
{
pyb_cc3000_spi_init();
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void SpiClose(void)
{
DEBUG_printf("\tCC3000: SpiClose");
if (sSpiInformation.pRxPacket)
{
sSpiInformation.pRxPacket = 0;
}
/* Disable Interrupt in GPIOA module... */
tSLInformation.WlanInterruptDisable();
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void SpiOpen(gcSpiHandleRx pfRxHandler)
{
DEBUG_printf("\tCC3000: SpiOpen");
sSpiInformation.ulSpiState = eSPI_STATE_POWERUP;
memset(spi_buffer, 0, sizeof(spi_buffer));
memset(wlan_tx_buffer, 0, sizeof(spi_buffer));
sSpiInformation.SPIRxHandler = pfRxHandler;
sSpiInformation.usTxPacketLength = 0;
sSpiInformation.pTxPacket = NULL;
sSpiInformation.pRxPacket = (unsigned char *)spi_buffer;
sSpiInformation.usRxPacketLength = 0;
spi_buffer[CC3000_RX_BUFFER_SIZE - 1] = CC3000_BUFFER_MAGIC_NUMBER;
wlan_tx_buffer[CC3000_TX_BUFFER_SIZE - 1] = CC3000_BUFFER_MAGIC_NUMBER;
/* Enable interrupt on the GPIO pin of WLAN IRQ */
tSLInformation.WlanInterruptEnable();
DEBUG_printf("\tCC3000: Finished SpiOpen\n\r");
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
#if 0
extern uint8_t g_csPin, g_irqPin, g_vbatPin, g_IRQnum, g_SPIspeed;
int init_spi(void)
{
DEBUG_printf("\tCC3000: init_spi\n\r");
/* Set POWER_EN pin to output and disable the CC3000 by default */
pinMode(g_vbatPin, OUTPUT);
digitalWrite(g_vbatPin, 0);
delay(500);
/* Set CS pin to output (don't de-assert yet) */
pinMode(g_csPin, OUTPUT);
/* Set interrupt/gpio pin to input */
#if defined(INPUT_PULLUP)
pinMode(g_irqPin, INPUT_PULLUP);
#else
pinMode(g_irqPin, INPUT);
digitalWrite(g_irqPin, HIGH); // w/weak pullup
#endif
/* Initialise SPI (Mode 1) */
SPI.begin();
SPI.setDataMode(SPI_MODE1);
SPI.setBitOrder(MSBFIRST);
SPI.setClockDivider(g_SPIspeed);
// Newly-initialized SPI is in the same state that ASSERT_CS will set it
// to. Invoke DEASSERT (which also restores SPI registers) so the next
// ASSERT call won't clobber the ccspi_old* values -- we need those!
CC3000_DEASSERT_CS();
/* ToDo: Configure IRQ interrupt! */
DEBUG_printf("\tCC3000: Finished init_spi\n\r");
return(ESUCCESS);
}
#endif
/**************************************************************************/
/*!
*/
/**************************************************************************/
long SpiFirstWrite(unsigned char *ucBuf, unsigned short usLength)
{
DEBUG_printf("\tCC3000: SpiWriteFirst\n\r");
/* Workaround for the first transaction */
CC3000_ASSERT_CS();
/* delay (stay low) for ~50us */
pyb_delay_us(50);
/* SPI writes first 4 bytes of data */
SpiWriteDataSynchronous(ucBuf, 4);
pyb_delay_us(50);
SpiWriteDataSynchronous(ucBuf + 4, usLength - 4);
/* From this point on - operate in a regular manner */
sSpiInformation.ulSpiState = eSPI_STATE_IDLE;
CC3000_DEASSERT_CS();
return(0);
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
long SpiWrite(unsigned char *pUserBuffer, unsigned short usLength)
{
unsigned char ucPad = 0;
DEBUG_printf("\tCC3000: SpiWrite\n\r");
/* Figure out the total length of the packet in order to figure out if there is padding or not */
if(!(usLength & 0x0001))
{
ucPad++;
}
pUserBuffer[0] = WRITE;
pUserBuffer[1] = HI(usLength + ucPad);
pUserBuffer[2] = LO(usLength + ucPad);
pUserBuffer[3] = 0;
pUserBuffer[4] = 0;
usLength += (SPI_HEADER_SIZE + ucPad);
/* The magic number that resides at the end of the TX/RX buffer (1 byte after the allocated size)
* for the purpose of overrun detection. If the magic number is overwritten - buffer overrun
* occurred - and we will be stuck here forever! */
if (wlan_tx_buffer[CC3000_TX_BUFFER_SIZE - 1] != CC3000_BUFFER_MAGIC_NUMBER)
{
DEBUG_printf("\tCC3000: Error - No magic number found in SpiWrite\n\r");
while (1);
}
if (sSpiInformation.ulSpiState == eSPI_STATE_POWERUP)
{
while (sSpiInformation.ulSpiState != eSPI_STATE_INITIALIZED);
}
if (sSpiInformation.ulSpiState == eSPI_STATE_INITIALIZED)
{
/* This is time for first TX/RX transactions over SPI: the IRQ is down - so need to send read buffer size command */
SpiFirstWrite(pUserBuffer, usLength);
}
else
{
/* We need to prevent here race that can occur in case two back to back packets are sent to the
* device, so the state will move to IDLE and once again to not IDLE due to IRQ */
tSLInformation.WlanInterruptDisable();
while (sSpiInformation.ulSpiState != eSPI_STATE_IDLE);
sSpiInformation.ulSpiState = eSPI_STATE_WRITE_IRQ;
sSpiInformation.pTxPacket = pUserBuffer;
sSpiInformation.usTxPacketLength = usLength;
/* Assert the CS line and wait till SSI IRQ line is active and then initialize write operation */
CC3000_ASSERT_CS();
/* Re-enable IRQ - if it was not disabled - this is not a problem... */
tSLInformation.WlanInterruptEnable();
/* Check for a missing interrupt between the CS assertion and enabling back the interrupts */
if (tSLInformation.ReadWlanInterruptPin() == 0)
{
SpiWriteDataSynchronous(sSpiInformation.pTxPacket, sSpiInformation.usTxPacketLength);
sSpiInformation.ulSpiState = eSPI_STATE_IDLE;
CC3000_DEASSERT_CS();
}
}
/* Due to the fact that we are currently implementing a blocking situation
* here we will wait till end of transaction */
while (eSPI_STATE_IDLE != sSpiInformation.ulSpiState);
return(0);
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void SpiWriteDataSynchronous(unsigned char *data, unsigned short size)
{
int bSend = 0, bRecv = 0;
while (bSend<size || bRecv<size) {
int r = pyb_cc3000_spi_send((bSend<size)?data[bSend]:-1);
bSend++;
if (bSend>0 && r>=0) bRecv++;
}
pyb_delay_us(10); // because of final clock pulse
DEBUG_printf("SpiWriteDataSynchronous: data=%p size=%u bSend=%d bRecv=%d [%x %x %x %x]\n", data, size, bSend, bRecv, data[0], data[1], data[2], data[3]);
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void SpiReadDataSynchronous(unsigned char *data, unsigned short size)
{
int bSend = 0, bRecv = 0;
while (bSend<size || bRecv<size) {
int r = pyb_cc3000_spi_send((bSend<size)?READ:-1);
bSend++;
if (bSend>0 && r>=0) data[bRecv++] = r;
}
pyb_delay_us(10); // because of final clock pulse
DEBUG_printf("SpiReadDataSynchronous: data=%p size=%u bSend=%d bRecv=%d [%x %x %x %x]\n", data, size, bSend, bRecv, data[0], data[1], data[2], data[3]);
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void SpiReadHeader(void)
{
DEBUG_printf("\tCC3000: SpiReadHeader\n\r");
SpiReadDataSynchronous(sSpiInformation.pRxPacket, HEADERS_SIZE_EVNT);
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
long SpiReadDataCont(void)
{
long data_to_recv;
unsigned char *evnt_buff, type;
DEBUG_printf("\tCC3000: SpiReadDataCont\n\r");
/* Determine what type of packet we have */
evnt_buff = sSpiInformation.pRxPacket;
data_to_recv = 0;
STREAM_TO_UINT8((uint8_t *)(evnt_buff + SPI_HEADER_SIZE), HCI_PACKET_TYPE_OFFSET, type);
switch(type)
{
case HCI_TYPE_DATA:
{
/* We need to read the rest of data.. */
STREAM_TO_UINT16((char *)(evnt_buff + SPI_HEADER_SIZE), HCI_DATA_LENGTH_OFFSET, data_to_recv);
if (!((HEADERS_SIZE_EVNT + data_to_recv) & 1))
{
data_to_recv++;
}
if (data_to_recv)
{
SpiReadDataSynchronous(evnt_buff + HEADERS_SIZE_EVNT, data_to_recv);
}
break;
}
case HCI_TYPE_EVNT:
{
/* Calculate the rest length of the data */
STREAM_TO_UINT8((char *)(evnt_buff + SPI_HEADER_SIZE), HCI_EVENT_LENGTH_OFFSET, data_to_recv);
data_to_recv -= 1;
/* Add padding byte if needed */
if ((HEADERS_SIZE_EVNT + data_to_recv) & 1)
{
data_to_recv++;
}
if (data_to_recv)
{
SpiReadDataSynchronous(evnt_buff + HEADERS_SIZE_EVNT, data_to_recv);
}
sSpiInformation.ulSpiState = eSPI_STATE_READ_EOT;
break;
}
}
return (0);
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void SpiPauseSpi(void)
{
DEBUG_printf("\tCC3000: SpiPauseSpi\n\r");
ccspi_int_enabled = 0;
pyb_cc3000_pause_spi();
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void SpiResumeSpi(void)
{
DEBUG_printf("\tCC3000: SpiResumeSpi\n\r");
ccspi_int_enabled = 1;
pyb_cc3000_resume_spi();
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void SpiTriggerRxProcessing(void)
{
DEBUG_printf("\tCC3000: SpiTriggerRxProcessing\n\r");
/* Trigger Rx processing */
SpiPauseSpi();
CC3000_DEASSERT_CS();
//DEBUG_printf("Magic?\n\r");
/* The magic number that resides at the end of the TX/RX buffer (1 byte after the allocated size)
* for the purpose of detection of the overrun. If the magic number is overriten - buffer overrun
* occurred - and we will stuck here forever! */
if (sSpiInformation.pRxPacket[CC3000_RX_BUFFER_SIZE - 1] != CC3000_BUFFER_MAGIC_NUMBER)
{
/* You've got problems if you're here! */
DEBUG_printf("\tCC3000: ERROR - magic number missing!\n\r");
while (1);
}
//DEBUG_printf("OK!\n\r");
sSpiInformation.ulSpiState = eSPI_STATE_IDLE;
sSpiInformation.SPIRxHandler(sSpiInformation.pRxPacket + SPI_HEADER_SIZE);
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void SSIContReadOperation(void)
{
DEBUG_printf("\tCC3000: SpiContReadOperation\n\r");
/* The header was read - continue with the payload read */
if (!SpiReadDataCont())
{
/* All the data was read - finalize handling by switching to teh task
* and calling from task Event Handler */
//DEBUG_printf("SPItrig\n\r");
SpiTriggerRxProcessing();
}
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void WriteWlanPin( unsigned char val )
{
pyb_cc3000_set_en(val == WLAN_ENABLE);
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
long ReadWlanInterruptPin(void)
{
DEBUG_printf("CC3000: ReadWlanInterruptPin\n");
return pyb_cc3000_get_irq();
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void WlanInterruptEnable()
{
DEBUG_printf("\tCC3000: WlanInterruptEnable.\n\r");
// delay(100);
ccspi_int_enabled = 1;
pyb_cc3000_enable_irq();
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void WlanInterruptDisable()
{
DEBUG_printf("\tCC3000: WlanInterruptDisable\n\r");
ccspi_int_enabled = 0;
pyb_cc3000_disable_irq();
}
//*****************************************************************************
//
//! sendDriverPatch
//!
//! @param pointer to the length
//!
//! @return none
//!
//! @brief The function returns a pointer to the driver patch:
//! since there is no patch in the host - it returns 0
//
//*****************************************************************************
char *sendDriverPatch(unsigned long *Length) {
*Length = 0;
return NULL;
}
//*****************************************************************************
//
//! sendBootLoaderPatch
//!
//! @param pointer to the length
//!
//! @return none
//!
//! @brief The function returns a pointer to the boot loader patch:
//! since there is no patch in the host - it returns 0
//
//*****************************************************************************
char *sendBootLoaderPatch(unsigned long *Length) {
*Length = 0;
return NULL;
}
//*****************************************************************************
//
//! sendWLFWPatch
//!
//! @param pointer to the length
//!
//! @return none
//!
//! @brief The function returns a pointer to the FW patch:
//! since there is no patch in the host - it returns 0
//
//*****************************************************************************
char *sendWLFWPatch(unsigned long *Length) {
*Length = 0;
return NULL;
}
/**************************************************************************/
/*!
*/
/**************************************************************************/
void SpiIntGPIOHandler(void)
{
DEBUG_printf("SpiIntGPIOHandler\n");
ccspi_is_in_irq = 1;
if (sSpiInformation.ulSpiState == eSPI_STATE_POWERUP)
{
//This means IRQ line was low call a callback of HCI Layer to inform
//on event
sSpiInformation.ulSpiState = eSPI_STATE_INITIALIZED;
}
else if (sSpiInformation.ulSpiState == eSPI_STATE_IDLE)
{
sSpiInformation.ulSpiState = eSPI_STATE_READ_IRQ;
/* IRQ line goes down - we are start reception */
CC3000_ASSERT_CS();
// Wait for TX/RX Compete which will come as DMA interrupt
SpiReadHeader();
sSpiInformation.ulSpiState = eSPI_STATE_READ_EOT;
SSIContReadOperation();
}
else if (sSpiInformation.ulSpiState == eSPI_STATE_WRITE_IRQ)
{
SpiWriteDataSynchronous(sSpiInformation.pTxPacket, sSpiInformation.usTxPacketLength);
sSpiInformation.ulSpiState = eSPI_STATE_IDLE;
CC3000_DEASSERT_CS();
}
ccspi_is_in_irq = 0;
}
#if 0
void SPI_IRQ(void)
{
ccspi_is_in_irq = 1;
DEBUG_printf("\tCC3000: Entering SPI_IRQ\n\r");
if (sSpiInformation.ulSpiState == eSPI_STATE_POWERUP)
{
/* IRQ line was low ... perform a callback on the HCI Layer */
sSpiInformation.ulSpiState = eSPI_STATE_INITIALIZED;
}
else if (sSpiInformation.ulSpiState == eSPI_STATE_IDLE)
{
//DEBUG_printf("IDLE\n\r");
sSpiInformation.ulSpiState = eSPI_STATE_READ_IRQ;
/* IRQ line goes down - start reception */
CC3000_ASSERT_CS();
// Wait for TX/RX Compete which will come as DMA interrupt
SpiReadHeader();
sSpiInformation.ulSpiState = eSPI_STATE_READ_EOT;
//DEBUG_printf("SSICont\n\r");
SSIContReadOperation();
}
else if (sSpiInformation.ulSpiState == eSPI_STATE_WRITE_IRQ)
{
SpiWriteDataSynchronous(sSpiInformation.pTxPacket, sSpiInformation.usTxPacketLength);
sSpiInformation.ulSpiState = eSPI_STATE_IDLE;
CC3000_DEASSERT_CS();
}
DEBUG_printf("\tCC3000: Leaving SPI_IRQ\n\r");
ccspi_is_in_irq = 0;
return;
}
#endif
//*****************************************************************************
//
//! cc3k_int_poll
//!
//! \brief checks if the interrupt pin is low
//! just in case the hardware missed a falling edge
//! function is in ccspi.cpp
//
//*****************************************************************************
void cc3k_int_poll()
{
if (pyb_cc3000_get_irq() == 0 && ccspi_is_in_irq == 0 && ccspi_int_enabled != 0) {
SpiIntGPIOHandler();
}
}
#endif // MICROPY_HW_ENABLE_CC3K

View File

@ -1,178 +0,0 @@
#include <stdio.h>
#include <stdint.h>
#include "stm32f4xx_hal.h"
#include "mpconfig.h"
#include "nlr.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
#include "pin.h"
#include "genhdr/pins.h"
#include "led.h"
#include "extint.h"
#include "spi.h"
#include "ccspi.h"
#include "pybcc3k.h"
#if MICROPY_HW_ENABLE_CC3K
#if 1 // print debugging info
#define DEBUG_printf(args...) printf(args)
#else // don't print debugging info
#define DEBUG_printf(args...) (void)0
#endif
// IRQ on PA14, input, pulled up, active low
// EN on PC7, output, active high
// CS on PC6, output, active low
// SPI2 on PB15=MOSI, PB14=MISO, PB13=SCK
// SCK for CC3000: max 16MHz, low when idle, data sampled on falling edge
#define PIN_CS pin_B12 // Y5
#define PIN_EN pin_B9 // Y4
#define PIN_IRQ pin_B8 // Y3
#define SPI_HANDLE SPIHandle2
// TODO this could be really wrong wrt calibration
void pyb_delay_us(uint32_t usec) {
volatile uint32_t count = 0;
const uint32_t utime = (160 * usec / 5);
do {
if (++count > utime) {
return;
}
} while (1);
}
void pyb_cc3000_set_en(int val) {
DEBUG_printf("pyb_cc3000_set_en val=%d\n", val);
if (val) {
PIN_EN.gpio->BSRRL = PIN_EN.pin_mask; // set pin high
} else {
PIN_EN.gpio->BSRRH = PIN_EN.pin_mask; // set pin low
}
}
void pyb_cc3000_set_cs(int val) {
DEBUG_printf("pyb_cc3000_set_cs val=%d\n", val);
if (val) {
PIN_CS.gpio->BSRRL = PIN_CS.pin_mask; // set pin high
} else {
PIN_CS.gpio->BSRRH = PIN_CS.pin_mask; // set pin low
}
}
int pyb_cc3000_get_irq(void) {
if ((PIN_IRQ.gpio->IDR & PIN_IRQ.pin_mask) == 0) {
return 0;
} else {
return 1;
}
}
uint32_t exti14_enabled = 0; // TODO hack; do it properly!
uint32_t exti14_missed = 0; // TODO hack; do it properly!
void pyb_cc3000_enable_irq(void) {
DEBUG_printf("pyb_cc3000_enable_irq: en=%lu miss=%lu\n", exti14_enabled, exti14_missed);
if (exti14_missed) {
// doesn't look like this is needed
DEBUG_printf("pyb_cc3000_enable_irq: handling missed IRQ\n");
/*
// TODO hack if we have a pending IRQ
extern void SpiIntGPIOHandler(void);
*/
SpiIntGPIOHandler();
exti14_missed = 0;
}
exti14_enabled = 1;
}
void pyb_cc3000_disable_irq(void) {
DEBUG_printf("pyb_cc3000_disable_irq: en=%lu miss=%lu\n", exti14_enabled, exti14_missed);
exti14_enabled = 0;
}
void pyb_cc3000_pause_spi(void) {
DEBUG_printf("pyb_cc3000_pause_spi\n");
exti14_enabled = 0;
}
void pyb_cc3000_resume_spi(void) {
DEBUG_printf("pyb_cc3000_resume_spi\n");
exti14_enabled = 1;
}
STATIC mp_obj_t irq_callback(mp_obj_t line) {
led_toggle(2);
//extern void SpiIntGPIOHandler(void);
//extern uint32_t exti14_enabled;
//extern uint32_t exti14_missed;
//printf("-> EXTI14 en=%lu miss=%lu\n", exti14_enabled, exti14_missed);
if (exti14_enabled) {
exti14_missed = 0;
SpiIntGPIOHandler(); // CC3000 interrupt
} else {
exti14_missed = 1;
}
//printf("<- EXTI14 done\n");
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(irq_callback_obj, irq_callback);
void pyb_cc3000_spi_init(void) {
DEBUG_printf("pyb_cc3000_spi_init\n");
/*
inf.baudRate = 100000; // FIXME - just slow for debug
inf.spiMode = SPIF_SPI_MODE_1; // Mode 1 CPOL= 0 CPHA= 1
*/
/*!< SPI configuration */
SPI_HANDLE.Init.Mode = SPI_MODE_MASTER;
SPI_HANDLE.Init.Direction = SPI_DIRECTION_2LINES;
SPI_HANDLE.Init.DataSize = SPI_DATASIZE_8BIT; // should be correct
SPI_HANDLE.Init.CLKPolarity = SPI_POLARITY_LOW; // clock is low when idle
SPI_HANDLE.Init.CLKPhase = SPI_PHASE_2EDGE; // data latched on second edge, which is falling edge for low-idle
SPI_HANDLE.Init.NSS = SPI_NSS_SOFT; // software control
SPI_HANDLE.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; // clock freq = f_PCLK / this_prescale_value
SPI_HANDLE.Init.FirstBit = SPI_FIRSTBIT_MSB; // should be correct
SPI_HANDLE.Init.TIMode = SPI_TIMODE_DISABLED;
SPI_HANDLE.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED;
SPI_HANDLE.Init.CRCPolynomial = 7; // unused
spi_init(&SPI_HANDLE);
// configure wlan CS and EN pins
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.Speed = GPIO_SPEED_FAST;
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Alternate = 0;
GPIO_InitStructure.Pin = PIN_CS.pin_mask;
HAL_GPIO_Init(PIN_CS.gpio, &GPIO_InitStructure);
GPIO_InitStructure.Pin = PIN_EN.pin_mask;
HAL_GPIO_Init(PIN_EN.gpio, &GPIO_InitStructure);
pyb_cc3000_set_cs(1); // de-assert CS
pyb_cc3000_set_en(0); // disable wlan
// configure EXTI for PIN_IRQ
extint_register((mp_obj_t)&PIN_IRQ, GPIO_MODE_IT_FALLING, GPIO_PULLUP, (mp_obj_t)&irq_callback_obj, true, NULL);
// wait a little (ensure that WLAN takes effect)
HAL_Delay(500); // force a 500ms delay! FIXME
}
uint8_t pyb_cc3000_spi_send(uint8_t val) {
uint8_t data[1] = {val};
HAL_SPI_TransmitReceive(&SPI_HANDLE, data, data, 1, 1000);
return data[0];
}
#endif // MICROPY_HW_ENABLE_CC3K

View File

@ -1,12 +0,0 @@
void pyb_delay_us(uint32_t us);
void pyb_cc3000_set_en(int val);
void pyb_cc3000_set_cs(int val);
int pyb_cc3000_get_irq(void);
void pyb_cc3000_enable_irq(void);
void pyb_cc3000_disable_irq(void);
void pyb_cc3000_pause_spi(void);
void pyb_cc3000_resume_spi(void);
void pyb_cc3000_spi_init(void);
uint8_t pyb_cc3000_spi_send(uint8_t val);