1.将A27新UI文件夹重命名为CANUI 2.A272O新版本发布
This commit is contained in:
@ -0,0 +1,281 @@
|
||||
/***********************************************************************************************************************
|
||||
* Copyright (C) 2021 Arkmicro Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* File Name : NetworkInterface.c
|
||||
* Device(s) : RTL8189FTV
|
||||
* Description : Interfaces FreeRTOS TCP/IP stack to RX Ethernet driver.
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* FreeRTOS includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "FreeRTOS_IP.h"
|
||||
#include "FreeRTOS_IP_Private.h"
|
||||
/*#include "FreeRTOS_DNS.h" */
|
||||
#include "NetworkBufferManagement.h"
|
||||
#include "NetworkInterface.h"
|
||||
#include "wifi_constants.h"
|
||||
#include "net_stack_intf.h"
|
||||
|
||||
#define USE_AP 0
|
||||
//#define DUMP_NETWORK_DATA
|
||||
#undef DUMP_NETWORK_DATA
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eMACInit, /* Must initialise MAC. */
|
||||
eMACPass, /* Initialisation was successful. */
|
||||
eMACFailed, /* Initialisation failed. */
|
||||
} eMAC_INIT_STATUS_TYPE;
|
||||
|
||||
static eMAC_INIT_STATUS_TYPE xMacInitStatus = eMACInit;
|
||||
|
||||
extern void cmd_test(const char* temp_uart_buf);
|
||||
|
||||
static int InitializeNetwork( void );
|
||||
static int scan_comp_flag = 0;
|
||||
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function Name: xNetworkInterfaceInitialise ()
|
||||
* Description : Initialization of Ethernet driver.
|
||||
* Arguments : none
|
||||
* Return Value : pdPASS, pdFAIL
|
||||
**********************************************************************************************************************/
|
||||
BaseType_t xNetworkInterfaceInitialise( void )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
|
||||
if( xMacInitStatus == eMACInit )
|
||||
{
|
||||
//rltk_wlan_set_netif_info(0, NULL, "00:0c:29:5d:2e:05");
|
||||
/*
|
||||
* Perform the hardware specific network initialization here using the Ethernet driver library to initialize the
|
||||
* Ethernet hardware, initialize DMA descriptors, and perform a PHY auto-negotiation to obtain a network link.
|
||||
*
|
||||
* InitialiseNetwork() uses Ethernet peripheral driver library function, and returns 0 if the initialization fails.
|
||||
*/
|
||||
if( InitializeNetwork() == pdFALSE )
|
||||
{
|
||||
xMacInitStatus = eMACFailed;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Indicate that the MAC initialisation succeeded. */
|
||||
xMacInitStatus = eMACPass;
|
||||
}
|
||||
|
||||
FreeRTOS_printf( ( "InitializeNetwork returns %s\n", ( xMacInitStatus == eMACPass ) ? "OK" : " Fail" ) );
|
||||
}
|
||||
|
||||
if( xMacInitStatus == eMACPass )
|
||||
{
|
||||
xReturn = pdPASS;
|
||||
}
|
||||
else
|
||||
{
|
||||
xReturn = pdFAIL;
|
||||
}
|
||||
|
||||
FreeRTOS_printf( ( "xNetworkInterfaceInitialise returns %d\n", xReturn ) );
|
||||
|
||||
return xReturn;
|
||||
} /* End of function xNetworkInterfaceInitialise() */
|
||||
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function Name: xNetworkInterfaceOutput ()
|
||||
* Description : Simple network output interface.
|
||||
* Arguments : pxDescriptor, xReleaseAfterSend
|
||||
* Return Value : pdTRUE, pdFALSE
|
||||
**********************************************************************************************************************/
|
||||
BaseType_t xNetworkInterfaceOutput( NetworkBufferDescriptor_t * const pxDescriptor,
|
||||
BaseType_t xReleaseAfterSend )
|
||||
{
|
||||
BaseType_t xReturn = pdFALSE;
|
||||
struct eth_drv_sg sg_list = {0};
|
||||
|
||||
if (xCheckLoopback( pxDescriptor, xReleaseAfterSend ) != 0 ) {
|
||||
return pdTRUE;
|
||||
}
|
||||
|
||||
if (!rltk_wlan_running(0)) {
|
||||
return pdFALSE;
|
||||
}
|
||||
|
||||
sg_list.buf = (unsigned int)pxDescriptor->pucEthernetBuffer;
|
||||
sg_list.len = (unsigned int)pxDescriptor->xDataLength;
|
||||
#ifdef DUMP_NETWORK_DATA
|
||||
if (1) {
|
||||
int i;
|
||||
char* tmp = (char *)pxDescriptor->pucEthernetBuffer;
|
||||
printf("\r\n send:");
|
||||
for (i = 0; i < sg_list.len; i++) {
|
||||
printf("%02x ", tmp[i]);
|
||||
}printf("send end\r\n");
|
||||
}
|
||||
#endif
|
||||
xReturn = (BaseType_t)rltk_wlan_send(0, &sg_list, 1, pxDescriptor->xDataLength);
|
||||
|
||||
xReturn = pdTRUE;
|
||||
|
||||
if( xReleaseAfterSend != pdFALSE )
|
||||
{
|
||||
/* It is assumed SendData() copies the data out of the FreeRTOS+TCP Ethernet
|
||||
* buffer. The Ethernet buffer is therefore no longer needed, and must be
|
||||
* freed for re-use. */
|
||||
vReleaseNetworkBufferAndDescriptor( pxDescriptor );
|
||||
}
|
||||
|
||||
return xReturn;
|
||||
} /* End of function xNetworkInterfaceOutput() */
|
||||
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function Name: vNetworkInterfaceAllocateRAMToBuffers ()
|
||||
* Description : .
|
||||
* Arguments : pxNetworkBuffers
|
||||
* Return Value : none
|
||||
**********************************************************************************************************************/
|
||||
void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkBuffers[ ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS ] )
|
||||
{
|
||||
} /* End of function vNetworkInterfaceAllocateRAMToBuffers() */
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function Name: InitializeNetwork ()
|
||||
* Description :
|
||||
* Arguments : none
|
||||
* Return Value : pdTRUE, pdFALSE
|
||||
**********************************************************************************************************************/
|
||||
#include "wifi_structures.h"
|
||||
|
||||
|
||||
static rtw_result_t ark_rtw_scan_result_handler( rtw_scan_handler_result_t* malloced_scan_result )
|
||||
{
|
||||
char bssid[32] = {0};
|
||||
char *ptr = malloced_scan_result->ap_details.BSSID.octet;
|
||||
sprintf(bssid, "%02x:%02x:%02x:%02x:%02x:%02x", ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5]);
|
||||
printf("\r\nSSID:%s Bssid:%s Signal strength:%d DB\r\n", malloced_scan_result->ap_details.SSID.val, bssid,
|
||||
malloced_scan_result->ap_details.signal_strength);
|
||||
if (malloced_scan_result->scan_complete != 0) {
|
||||
printf("scan complete!\r\n");
|
||||
scan_comp_flag = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extern struct sdio_func *wifi_sdio_func;
|
||||
|
||||
int ark_wlan_init(void)
|
||||
{
|
||||
int return_code = 0;
|
||||
char *ssid = "ap630";
|
||||
|
||||
//rltk_wlan_ctx_init();
|
||||
|
||||
#if USE_AP
|
||||
/*if (wifi_on(RTW_MODE_AP) < 0) {
|
||||
printf("\r\nopen wifi failed \r\n");
|
||||
return return_code;
|
||||
}
|
||||
printf("\r\n wifi init finished!\r\n");*/
|
||||
//wifi_start_ap(ssid, RTW_SECURITY_OPEN, NULL, strlen(ssid), 0, 1);
|
||||
cmd_test("wifi_ap ap630 1");
|
||||
printf("\r\n wifi start now!\r\n");
|
||||
#else
|
||||
//cmd_test("wifi_debug set_mac 000C295D2E05");//0x00, 0x0c, 0x29, 0x5d, 0x2e, 0x05
|
||||
if (wifi_on(RTW_MODE_STA) < 0) {
|
||||
printf("\r\nopen wifi failed \r\n");
|
||||
return return_code;
|
||||
}
|
||||
scan_comp_flag = 0;
|
||||
|
||||
//wifi_set_mac_address("000c295d2e03");
|
||||
|
||||
wifi_scan_networks(ark_rtw_scan_result_handler, NULL);
|
||||
|
||||
while(scan_comp_flag == 0)
|
||||
mdelay(500);
|
||||
ssid = "ark-9528";
|
||||
|
||||
cmd_test("wifi_connect ark-9528 02345678");
|
||||
|
||||
#endif
|
||||
return_code = 1;
|
||||
return return_code;
|
||||
}
|
||||
|
||||
static int InitializeNetwork( void )
|
||||
{
|
||||
BaseType_t return_code = pdFALSE;
|
||||
|
||||
return pdTRUE;
|
||||
} /* End of function InitializeNetwork() */
|
||||
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* End of file "NetworkInterface.c"
|
||||
**********************************************************************************************************************/
|
||||
static UBaseType_t ulNextRand;
|
||||
BaseType_t xTotalSuccess = 0;
|
||||
|
||||
|
||||
UBaseType_t uxRand( void )
|
||||
{
|
||||
const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
|
||||
|
||||
ulNextRand = portGET_RUN_TIME_COUNTER_VALUE();
|
||||
|
||||
ulNextRand = ( ulMultiplier * ulNextRand ) + ulIncrement;
|
||||
return( ( int ) ( ulNextRand >> 16UL ) & 0x7fffUL );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvSRand( UBaseType_t ulSeed )
|
||||
{
|
||||
ulNextRand = ulSeed;
|
||||
}
|
||||
|
||||
|
||||
extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
|
||||
uint16_t usSourcePort,
|
||||
uint32_t ulDestinationAddress,
|
||||
uint16_t usDestinationPort )
|
||||
{
|
||||
( void ) ulSourceAddress;
|
||||
( void ) usSourcePort;
|
||||
( void ) ulDestinationAddress;
|
||||
( void ) usDestinationPort;
|
||||
|
||||
return uxRand();
|
||||
}
|
||||
|
||||
BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber )
|
||||
{
|
||||
*( pulNumber ) = uxRand();
|
||||
return pdTRUE;
|
||||
}
|
||||
|
||||
|
||||
void vApplicationPingReplyHook( ePingReplyStatus_t eStatus,
|
||||
uint16_t usIdentifier )
|
||||
{
|
||||
//if( eStatus == eSuccess )
|
||||
{
|
||||
FreeRTOS_printf( ( "Ping response received. ID: %d\r\n", usIdentifier ) );
|
||||
printf("Ping response received. ID: %d\r\n", usIdentifier);
|
||||
|
||||
/* Increment successful ping replies. */
|
||||
xTotalSuccess++;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,108 @@
|
||||
/*
|
||||
* FreeRTOS V1.4.8
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* http://aws.amazon.com/freertos
|
||||
* http://www.FreeRTOS.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file aws_wifi_config.h
|
||||
* @brief WiFi module configuration parameters.
|
||||
*/
|
||||
|
||||
#ifndef _AWS_WIFI_CONFIG_H_
|
||||
#define _AWS_WIFI_CONFIG_H_
|
||||
|
||||
/**
|
||||
* @brief Maximum number of sockets that can be created simultaneously.
|
||||
*/
|
||||
#define wificonfigMAX_SOCKETS ( 4 )
|
||||
|
||||
/**
|
||||
* @brief Maximum number of connection retries.
|
||||
*/
|
||||
#define wificonfigNUM_CONNECTION_RETRY ( 3 )
|
||||
|
||||
/**
|
||||
* @brief Maximum number of connected station in Access Point mode.
|
||||
*/
|
||||
#define wificonfigMAX_CONNECTED_STATIONS ( 4 )
|
||||
|
||||
/**
|
||||
* @brief Max number of network profiles stored in Non Volatile memory,
|
||||
* set to zero if not supported.
|
||||
*/
|
||||
#define wificonfigMAX_NETWORK_PROFILES ( 0 )
|
||||
|
||||
/**
|
||||
* @brief Max SSID length
|
||||
*/
|
||||
#define wificonfigMAX_SSID_LEN ( 32 )
|
||||
|
||||
/**
|
||||
* @brief Max BSSID length
|
||||
*/
|
||||
#define wificonfigMAX_BSSID_LEN ( 6 )
|
||||
|
||||
/**
|
||||
* @brief Max number of WEP keys supported.
|
||||
*/
|
||||
|
||||
#define wificonfigMAX_WEPKEYS ( 4 )
|
||||
|
||||
/**
|
||||
* @brief Max WEP key length
|
||||
*/
|
||||
#define wificonfigMAX_WEPKEY_LEN ( 26 )
|
||||
|
||||
/**
|
||||
* @brief Max passphrase length
|
||||
*/
|
||||
#define wificonfigMAX_PASSPHRASE_LEN ( 32 )
|
||||
|
||||
/**
|
||||
* @brief Soft Access point SSID
|
||||
*/
|
||||
#define wificonfigACCESS_POINT_SSID_PREFIX ( "Enter SSID for Soft AP" )
|
||||
|
||||
/**
|
||||
* @brief Soft Access point Passkey
|
||||
*/
|
||||
#define wificonfigACCESS_POINT_PASSKEY ( "Enter Password for Soft AP" )
|
||||
|
||||
/**
|
||||
* @brief Soft Access point Channel
|
||||
*/
|
||||
#define wificonfigACCESS_POINT_CHANNEL ( 11 )
|
||||
|
||||
/**
|
||||
* @brief WiFi semaphore timeout
|
||||
*/
|
||||
#define wificonfigMAX_SEMAPHORE_WAIT_TIME_MS ( 60000 )
|
||||
|
||||
/**
|
||||
* @brief Soft Access point security
|
||||
* WPA2 Security, see WIFISecurity_t
|
||||
* other values are - eWiFiSecurityOpen, eWiFiSecurityWEP, eWiFiSecurityWPA
|
||||
*/
|
||||
#define wificonfigACCESS_POINT_SECURITY ( eWiFiSecurityWPA2 )
|
||||
|
||||
#endif /* _AWS_WIFI_CONFIG_H_ */
|
@ -0,0 +1,724 @@
|
||||
/*
|
||||
* FreeRTOS Wi-Fi V1.0.0
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* http://aws.amazon.com/freertos
|
||||
* http://www.FreeRTOS.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file iot_wifi.c
|
||||
* @brief Wi-Fi Interface.
|
||||
*/
|
||||
#include <stdbool.h>
|
||||
/* Socket and Wi-Fi interface includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "iot_wifi.h"
|
||||
|
||||
/* Wi-Fi configuration includes. */
|
||||
#include "aws_wifi_config.h"
|
||||
|
||||
#include "wifi_constants.h"
|
||||
#include "net_stack_intf.h"
|
||||
#include "FreeRTOS_IP.h"
|
||||
#include "FreeRTOS_Sockets.h"
|
||||
#include "semphr.h"
|
||||
#include "wifi_structures.h"
|
||||
|
||||
static rtw_mode_t g_wifi_mode = RTW_MODE_STA;
|
||||
static SemaphoreHandle_t xWiFiSem;
|
||||
static bool wifi_started;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_On( void )
|
||||
{
|
||||
WIFIReturnCode_t ret = eWiFiFailure;
|
||||
|
||||
xSemaphoreTake(xWiFiSem, portMAX_DELAY );
|
||||
if (wifi_started) {
|
||||
ret = eWiFiSuccess;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (wifi_on(g_wifi_mode) < 0) {
|
||||
printf("\r\nopen wifi failed \r\n");
|
||||
goto exit;
|
||||
}
|
||||
wifi_started = true;
|
||||
ret = eWiFiSuccess;
|
||||
exit:
|
||||
xSemaphoreGive(xWiFiSem);
|
||||
return ret;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_Off( void )
|
||||
{
|
||||
xSemaphoreTake(xWiFiSem, portMAX_DELAY );
|
||||
wifi_off();
|
||||
wifi_started = false;
|
||||
xSemaphoreGive(xWiFiSem);
|
||||
return eWiFiSuccess;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static rtw_security_t convertWIFISecurity2rtw_security(WIFISecurity_t type)
|
||||
{
|
||||
rtw_security_t security_type = RTW_MODE_NONE;
|
||||
|
||||
switch (type) {
|
||||
case eWiFiSecurityOpen:
|
||||
security_type = RTW_SECURITY_OPEN;
|
||||
break;
|
||||
case eWiFiSecurityWPA2:
|
||||
security_type = RTW_SECURITY_WPA2_AES_PSK;
|
||||
break;
|
||||
default:
|
||||
security_type = RTW_SECURITY_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
return security_type;
|
||||
}
|
||||
|
||||
static WIFISecurity_t convertrtw_security2WIFISecurity(rtw_security_t type)
|
||||
{
|
||||
WIFISecurity_t security_type = eWiFiSecurityNotSupported;
|
||||
|
||||
switch (type) {
|
||||
case RTW_SECURITY_OPEN:
|
||||
security_type = eWiFiSecurityOpen;
|
||||
break;
|
||||
case RTW_SECURITY_WPA2_AES_PSK:
|
||||
security_type = eWiFiSecurityWPA2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return security_type;
|
||||
}
|
||||
|
||||
|
||||
static rtw_mode_t convertWIFIDevMode2rtwMode(WIFIDeviceMode_t mode)
|
||||
{
|
||||
rtw_mode_t rtw_mode = RTW_MODE_NONE;
|
||||
|
||||
switch (mode) {
|
||||
case eWiFiModeStation:
|
||||
rtw_mode = RTW_MODE_STA;
|
||||
break;
|
||||
case eWiFiModeAP:
|
||||
rtw_mode = RTW_MODE_AP;
|
||||
break;
|
||||
case eWiFiModeP2P:
|
||||
rtw_mode = RTW_MODE_P2P;
|
||||
break;
|
||||
case eWiFiModeAPStation:
|
||||
rtw_mode = RTW_MODE_STA_AP;
|
||||
break;
|
||||
case eWiFiModeNotSupported:
|
||||
rtw_mode = RTW_MODE_NONE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return rtw_mode;
|
||||
}
|
||||
|
||||
static WIFIDeviceMode_t convertrtwMode2WIFIDevMode(rtw_mode_t rtw_mode)
|
||||
{
|
||||
WIFIDeviceMode_t dev_mode = eWiFiModeNotSupported;
|
||||
|
||||
switch (rtw_mode) {
|
||||
case RTW_MODE_STA:
|
||||
dev_mode = eWiFiModeStation;
|
||||
break;
|
||||
case RTW_MODE_AP:
|
||||
dev_mode = eWiFiModeAP;
|
||||
break;
|
||||
case RTW_MODE_P2P:
|
||||
dev_mode = eWiFiModeP2P;
|
||||
break;
|
||||
case RTW_MODE_STA_AP:
|
||||
dev_mode = eWiFiModeAPStation;
|
||||
break;
|
||||
case RTW_MODE_NONE:
|
||||
dev_mode = eWiFiModeNotSupported;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return dev_mode;
|
||||
}
|
||||
|
||||
|
||||
WIFIReturnCode_t WIFI_ConnectAP( const WIFINetworkParams_t * const pxNetworkParams )
|
||||
{
|
||||
rtw_security_t security_type;
|
||||
rtw_result_t ret = RTW_UNSUPPORTED;
|
||||
if (pxNetworkParams == NULL)
|
||||
return eWiFiFailure;
|
||||
xSemaphoreTake(xWiFiSem, portMAX_DELAY );
|
||||
security_type = convertWIFISecurity2rtw_security(pxNetworkParams->xSecurity);
|
||||
if (security_type == RTW_SECURITY_WPA2_AES_PSK) {
|
||||
ret = wifi_connect(pxNetworkParams->ucSSID,
|
||||
security_type,
|
||||
pxNetworkParams->xPassword.xWPA.cPassphrase,
|
||||
pxNetworkParams->ucSSIDLength,
|
||||
pxNetworkParams->xPassword.xWPA.ucLength, 0, NULL);
|
||||
} else if (security_type == RTW_SECURITY_OPEN) {
|
||||
ret = wifi_connect(pxNetworkParams->ucSSID,
|
||||
security_type,
|
||||
pxNetworkParams->xPassword.xWPA.cPassphrase,
|
||||
pxNetworkParams->ucSSIDLength,
|
||||
RTW_MIN_PSK_LEN, 0, NULL);
|
||||
}
|
||||
xSemaphoreGive(xWiFiSem);
|
||||
if (ret == RTW_TIMEOUT)
|
||||
return eWiFiTimeout;
|
||||
else if (ret != RTW_SUCCESS)
|
||||
return eWiFiFailure;
|
||||
return eWiFiSuccess;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_Disconnect( void )
|
||||
{
|
||||
xSemaphoreTake(xWiFiSem, portMAX_DELAY );
|
||||
wifi_disconnect();
|
||||
xSemaphoreGive(xWiFiSem);
|
||||
return eWiFiSuccess;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_Reset( void )
|
||||
{
|
||||
return eWiFiSuccess;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_SetMode( WIFIDeviceMode_t xDeviceMode )
|
||||
{
|
||||
WIFIReturnCode_t ret = eWiFiNotSupported;
|
||||
switch (xDeviceMode) {
|
||||
case eWiFiModeStation:
|
||||
ret = eWiFiSuccess;
|
||||
g_wifi_mode = RTW_MODE_STA;
|
||||
break;
|
||||
case eWiFiModeAP:
|
||||
ret = eWiFiSuccess;
|
||||
g_wifi_mode = RTW_MODE_AP;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetMode( WIFIDeviceMode_t * pxDeviceMode )
|
||||
{
|
||||
WIFIReturnCode_t ret = eWiFiNotSupported;
|
||||
if (NULL == pxDeviceMode)
|
||||
return ret;
|
||||
switch (g_wifi_mode) {
|
||||
case RTW_MODE_STA:
|
||||
ret = eWiFiSuccess;
|
||||
*pxDeviceMode = eWiFiModeStation;
|
||||
break;
|
||||
case RTW_MODE_AP:
|
||||
ret = eWiFiSuccess;
|
||||
*pxDeviceMode = eWiFiModeAP;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_NetworkAdd( const WIFINetworkProfile_t * const pxNetworkProfile,
|
||||
uint16_t * pusIndex )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_NetworkGet( WIFINetworkProfile_t * pxNetworkProfile,
|
||||
uint16_t usIndex )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_NetworkDelete( uint16_t usIndex )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_Ping( uint8_t * pucIPAddr,
|
||||
uint16_t usCount,
|
||||
uint32_t ulIntervalMS )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetMAC( uint8_t * pucMac )
|
||||
{
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetHostIP( char * pcHost,
|
||||
uint8_t * pucIPAddr )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
struct scan_data_ctx
|
||||
{
|
||||
WIFIScanResult_t *result;
|
||||
int index;
|
||||
int max_num;
|
||||
bool scan_stop;
|
||||
QueueHandle_t sem;
|
||||
};
|
||||
static rtw_result_t WIFI_scan_result_handler( rtw_scan_handler_result_t* malloced_scan_result )
|
||||
{
|
||||
char bssid[32] = {0};
|
||||
WIFIScanResult_t *result;
|
||||
struct scan_data_ctx* pscan_data = (struct scan_data_ctx*)malloced_scan_result->user_data;
|
||||
int len;
|
||||
char *ptr = malloced_scan_result->ap_details.BSSID.octet;
|
||||
sprintf(bssid, "%02x:%02x:%02x:%02x:%02x:%02x", ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5]);
|
||||
printf("\r\nSSID:%s Bssid:%s Signal strength:%d DB\r\n", malloced_scan_result->ap_details.SSID.val, bssid,
|
||||
malloced_scan_result->ap_details.signal_strength);
|
||||
if (pscan_data->scan_stop)
|
||||
return RTW_SUCCESS;
|
||||
if (pscan_data->index < pscan_data->max_num) {
|
||||
result = pscan_data->result + pscan_data->index;
|
||||
result->ucChannel = malloced_scan_result->ap_details.channel;
|
||||
result->cRSSI = malloced_scan_result->ap_details.signal_strength;
|
||||
result->xSecurity = convertrtw_security2WIFISecurity(malloced_scan_result->ap_details.security);
|
||||
len = wificonfigMAX_SSID_LEN;
|
||||
if (len < malloced_scan_result->ap_details.SSID.len)
|
||||
len = malloced_scan_result->ap_details.SSID.len;
|
||||
memcpy(result->ucSSID, malloced_scan_result->ap_details.SSID.val, len);
|
||||
len = wificonfigMAX_BSSID_LEN;
|
||||
if (len != sizeof(malloced_scan_result->ap_details.BSSID.octet))
|
||||
printf("wrong bssid len\r\n");
|
||||
memcpy(result->ucBSSID, malloced_scan_result->ap_details.BSSID.octet, len);
|
||||
}
|
||||
|
||||
if (malloced_scan_result->scan_complete != 0) {
|
||||
printf("scan complete!\r\n");
|
||||
xQueueSend(pscan_data->sem, NULL, 0);
|
||||
}
|
||||
pscan_data->index++;
|
||||
return RTW_SUCCESS;
|
||||
}
|
||||
|
||||
WIFIReturnCode_t WIFI_Scan( WIFIScanResult_t * pxBuffer,
|
||||
uint8_t ucNumNetworks )
|
||||
{
|
||||
WIFIReturnCode_t ret = eWiFiNotSupported;
|
||||
struct scan_data_ctx scan_data = {0};
|
||||
if (!wifi_started)
|
||||
ret = WIFI_On();
|
||||
scan_data.index = 0;
|
||||
scan_data.scan_stop = false;
|
||||
scan_data.max_num = ucNumNetworks;
|
||||
scan_data.result = pxBuffer;
|
||||
scan_data.sem = xQueueCreate(1, 0);
|
||||
xSemaphoreTake(xWiFiSem, portMAX_DELAY );
|
||||
wifi_scan_networks(WIFI_scan_result_handler, (void *)&scan_data);
|
||||
|
||||
ret = xQueueReceive(scan_data.sem, NULL, portMAX_DELAY);
|
||||
if( ret != pdPASS ) {
|
||||
ret = eWiFiFailure;
|
||||
goto exit;
|
||||
}
|
||||
scan_data.scan_stop = true;
|
||||
vSemaphoreDelete(scan_data.sem);
|
||||
ret = eWiFiSuccess;
|
||||
exit:
|
||||
xSemaphoreGive(xWiFiSem);
|
||||
return ret;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_StartAP( void )
|
||||
{
|
||||
WIFIReturnCode_t xWifiStatus;
|
||||
WIFI_SetMode(eWiFiModeAP);
|
||||
|
||||
xWifiStatus = WIFI_On();
|
||||
return xWifiStatus;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_StopAP( void )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_ConfigureAP( const WIFINetworkParams_t * const pxNetworkParams )
|
||||
{
|
||||
WIFIReturnCode_t xWifiStatus;
|
||||
int ret = -1;
|
||||
|
||||
if (NULL == pxNetworkParams)
|
||||
return eWiFiFailure;
|
||||
|
||||
if (eWiFiSecurityOpen == pxNetworkParams->xSecurity) {printf("WIFI_ConfigureAP channel:%d\r\n", pxNetworkParams->ucChannel);
|
||||
ret = wifi_start_ap(pxNetworkParams->ucSSID, RTW_SECURITY_OPEN, NULL,
|
||||
pxNetworkParams->ucSSIDLength, 0, pxNetworkParams->ucChannel);
|
||||
} else if (eWiFiSecurityWPA2 == pxNetworkParams->xSecurity) {
|
||||
ret = wifi_start_ap(pxNetworkParams->ucSSID, RTW_SECURITY_WPA2_AES_PSK,
|
||||
pxNetworkParams->xPassword.xWPA.cPassphrase,
|
||||
pxNetworkParams->ucSSIDLength, pxNetworkParams->xPassword.xWPA.ucLength,
|
||||
pxNetworkParams->ucChannel);
|
||||
}
|
||||
if (ret < 0)
|
||||
xWifiStatus = eWiFiFailure;
|
||||
else
|
||||
xWifiStatus = eWiFiSuccess;
|
||||
return xWifiStatus;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_SetPMMode( WIFIPMMode_t xPMModeType,
|
||||
const void * pvOptionValue )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetPMMode( WIFIPMMode_t * pxPMModeType,
|
||||
void * pvOptionValue )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_RegisterEvent( WIFIEventType_t xEventType,
|
||||
WIFIEventHandler_t xHandler )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t WIFI_IsConnected( const WIFINetworkParams_t * pxNetworkParams )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return pdFALSE;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_StartScan( WIFIScanConfig_t * pxScanConfig )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetScanResults( const WIFIScanResult_t ** pxBuffer,
|
||||
uint16_t * ucNumNetworks )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_StartConnectAP( const WIFINetworkParams_t * pxNetworkParams )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_StartDisconnect( void )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetConnectionInfo( WIFIConnectionInfo_t * pxConnectionInfo )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetIPInfo( WIFIIPConfiguration_t * pxIPConfig )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetRSSI( int8_t * pcRSSI )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetStationList( WIFIStationInfo_t * pxStationList,
|
||||
uint8_t * pcStationListSize )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_StartDisconnectStation( uint8_t * pucMac )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_SetMAC( uint8_t * pucMac )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_SetCountryCode( const char * pcCountryCode )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetCountryCode( char * pcCountryCode )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetStatistic( WIFIStatisticInfo_t * pxStats )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
WIFIReturnCode_t WIFI_GetCapability( WIFICapabilityInfo_t * pxCaps )
|
||||
{
|
||||
/* FIX ME. */
|
||||
return eWiFiNotSupported;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
int WIFI_Context_init()
|
||||
{
|
||||
if (xWiFiSem == NULL)
|
||||
xWiFiSem = xSemaphoreCreateMutex();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#define clientcredentialWIFI_SSID "ark-9528"
|
||||
#define clientcredentialWIFI_PASSWORD "02345678"
|
||||
#define ucNumNetworks 12
|
||||
|
||||
#define serverWIFI_SSID "ap630"
|
||||
|
||||
int wifi_sta_test_proc()
|
||||
{
|
||||
|
||||
WIFINetworkParams_t xNetworkParams = {0};
|
||||
WIFIReturnCode_t xWifiStatus;
|
||||
|
||||
WIFI_Context_init();
|
||||
|
||||
WIFI_SetMode(eWiFiModeStation);
|
||||
|
||||
printf("Turning on wifi...\r\n");
|
||||
xWifiStatus = WIFI_On();
|
||||
|
||||
printf("Checking status...\r\n");
|
||||
if( xWifiStatus == eWiFiSuccess ) {
|
||||
printf("WiFi module initialized.\r\n");
|
||||
} else {
|
||||
printf("WiFi module failed to initialize.\r\n" );
|
||||
// Handle module init failure
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Some boards might require additional initialization steps to use the Wi-Fi library. */
|
||||
|
||||
while (1) {
|
||||
printf("Starting scan\r\n");
|
||||
WIFIScanResult_t xScanResults[ ucNumNetworks ] = {0};
|
||||
xWifiStatus = WIFI_Scan( xScanResults, ucNumNetworks ); // Initiate scan
|
||||
|
||||
printf("Scan started\r\n");
|
||||
|
||||
// For each scan result, print out the SSID and RSSI
|
||||
if ( xWifiStatus == eWiFiSuccess ) {
|
||||
printf("Scan success\r\n");
|
||||
for ( uint8_t i=0; i<ucNumNetworks; i++ ) {
|
||||
printf("%s : %d \r\n", xScanResults[i].ucSSID, xScanResults[i].cRSSI);
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
printf("Scan failed, status code: %d\n", (int)xWifiStatus);
|
||||
return -1;
|
||||
}
|
||||
|
||||
vTaskDelay(200);
|
||||
}
|
||||
|
||||
/* Setup parameters. */
|
||||
memset(&xNetworkParams, 0, sizeof(xNetworkParams));
|
||||
xNetworkParams.ucSSIDLength = strlen( clientcredentialWIFI_SSID );
|
||||
memcpy(xNetworkParams.ucSSID, clientcredentialWIFI_SSID, xNetworkParams.ucSSIDLength);
|
||||
xNetworkParams.xPassword.xWPA.ucLength = strlen( clientcredentialWIFI_PASSWORD );
|
||||
memcpy(xNetworkParams.xPassword.xWPA.cPassphrase, clientcredentialWIFI_PASSWORD, xNetworkParams.ucSSIDLength);
|
||||
xNetworkParams.xSecurity = eWiFiSecurityWPA2;
|
||||
|
||||
// Connect!
|
||||
xWifiStatus = WIFI_ConnectAP( &( xNetworkParams ) );
|
||||
|
||||
if( xWifiStatus == eWiFiSuccess ){
|
||||
printf( "WiFi Connected to AP.\r\n" );
|
||||
} else {
|
||||
printf( "WiFi failed to connect to AP.\r\n" );
|
||||
// Handle connection failure
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
extern void cmd_test(const char* temp_uart_buf);
|
||||
int wifi_ap_test_proc()
|
||||
{
|
||||
|
||||
WIFINetworkParams_t xNetworkParams = {0};
|
||||
WIFIReturnCode_t xWifiStatus;
|
||||
|
||||
WIFI_Context_init();
|
||||
#if 0
|
||||
|
||||
WIFI_SetMode(eWiFiModeAP);
|
||||
|
||||
printf("Turning on wifi...\r\n");
|
||||
xWifiStatus = WIFI_On();
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
|
||||
printf("Checking status...\r\n");
|
||||
if( xWifiStatus == eWiFiSuccess ) {
|
||||
printf("WiFi module initialized.\r\n");
|
||||
} else {
|
||||
printf("WiFi module failed to initialize.\r\n" );
|
||||
// Handle module init failure
|
||||
return -1;
|
||||
}
|
||||
|
||||
//xNetworkParams.ucChannel = 1;
|
||||
//xNetworkParams.ucSSIDLength = (uint8_t)strlen(serverWIFI_SSID);
|
||||
//memcpy(xNetworkParams.ucSSID, serverWIFI_SSID, strlen(serverWIFI_SSID) + 1);
|
||||
//xNetworkParams.xSecurity = eWiFiSecurityOpen;
|
||||
|
||||
//xWifiStatus = WIFI_ConfigureAP(&xNetworkParams);
|
||||
//WIFINetworkParams_t *pxNetworkParams = &xNetworkParams;
|
||||
//printf("WIFI_ConfigureAP channel:%d\r\n", pxNetworkParams->ucChannel);
|
||||
//wifi_start_ap(pxNetworkParams->ucSSID, RTW_SECURITY_OPEN, NULL,
|
||||
// pxNetworkParams->ucSSIDLength, 0, pxNetworkParams->ucChannel);
|
||||
wifi_start_ap("ap630", RTW_SECURITY_OPEN, NULL, 5, 0, 1);
|
||||
xWifiStatus = eWiFiSuccess;
|
||||
if( xWifiStatus == eWiFiSuccess ){
|
||||
printf( "WiFi Configure AP.\r\n" );
|
||||
} else {
|
||||
printf( "WiFi failed to Configure AP.\r\n" );
|
||||
// Handle connection failure
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
#if 1
|
||||
cmd_test("wifi_ap ap630 1");
|
||||
#else
|
||||
char *ssid = "ap630";
|
||||
int channel = 1;
|
||||
int timeout = 20;
|
||||
wifi_off();
|
||||
vTaskDelay(pdMS_TO_TICKS(20));
|
||||
if (wifi_on(RTW_MODE_AP) < 0) {
|
||||
printf("\r\nopen wifi failed \r\n");
|
||||
return -1;
|
||||
}
|
||||
printf("\r\n wifi init finished!\r\n");
|
||||
//wifi_start_ap(ssid, RTW_SECURITY_OPEN, NULL, strlen(ssid), 0, 1);
|
||||
|
||||
wifi_start_ap(ssid,
|
||||
RTW_SECURITY_OPEN,
|
||||
NULL,
|
||||
strlen((const char *)ssid),
|
||||
0,
|
||||
channel
|
||||
);
|
||||
|
||||
while(1) {
|
||||
char essid[33];
|
||||
|
||||
if(wext_get_ssid("wlan0", (unsigned char *) essid) > 0) {
|
||||
if(strcmp((const char *) essid, (const char *)ssid) == 0) {
|
||||
printf("%s started\r\n", ssid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(timeout == 0) {
|
||||
printf("ERROR: Start AP timeout!\r\n");
|
||||
break;
|
||||
}
|
||||
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
|
||||
timeout --;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user