资源简介

这是个关于esp8266使用开发SDK固件的方式实现的在混乱模式下的WIFI探针,可搜索附近的各种wifi设备的MAC地址。

资源截图

代码片段和文件信息

/*
 * File : uart.c
 * Copyright (C) 2013 - 2016 Espressif Systems
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of version 3 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not see .
 */
#include “ets_sys.h“
#include “osapi.h“
#include “driver/uart.h“
#include “osapi.h“
#include “driver/uart_register.h“
#include “mem.h“
#include “os_type.h“
#include “client.h“
#include “user_main.h“


// UartDev is defined and initialized in rom code.
extern UartDevice    UartDev;

LOCAL struct UartBuffer* pTxBuffer = NULL;
LOCAL struct UartBuffer* pRxBuffer = NULL;

/*uart demo with a system task to output what uart receives*/
/*this is a example to process uart data from taskplease change the priority to fit your application task if exists*/
/*it might conflict with your task if soplease arrange the priority of different task  or combine it to a different event in the same task. */
#define uart_recvTaskPrio        0
#define uart_recvTaskQueueLen    10
os_event_t    uart_recvTaskQueue[uart_recvTaskQueueLen];

#define DBG  
#define DBG1 uart1_sendStr_no_wait
#define DBG2 os_printf


LOCAL void uart0_rx_intr_handler(void *para);
/******************************************************************************
 * FunctionName : uart_config
 * Description  : Internal used function
 *                UART0 used for data TX/RX RX buffer size is 0x100 interrupt enabled
 *                UART1 just used for debug output
 * Parameters   : uart_no use UART0 or UART1 defined ahead
 * Returns      : NONE
*******************************************************************************/
LOCAL void ICACHE_FLASH_ATTR
uart_config(uint8 uart_no)
{
    if (uart_no == UART1){
        PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO2_U FUNC_U1TXD_BK);
    }else{
        /* rcv_buff size if 0x100 */
        ETS_UART_INTR_ATTACH(uart0_rx_intr_handler&(UartDev.rcv_buff));
        PIN_PULLUP_DIS(PERIPHS_IO_MUX_U0TXD_U);
        PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U FUNC_U0TXD);
#if UART_HW_RTS
        PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U FUNC_U0RTS);   //HW FLOW CONTROL RTS PIN
        #endif
#if UART_HW_CTS
        PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U FUNC_U0CTS);   //HW FLOW CONTROL CTS PIN
        #endif
    }
    uart_div_modify(uart_no UART_CLK_FREQ / (UartDev.baut_rate));//SET BAUDRATE
    
    WRITE_PERI_REG(UART_CONF0(uart_no) ((UartDev.exist_parity & UART_PARITY_EN_M)  <<  UART_PARITY_EN_S) //SET BIT AND PARITY MODE
                                                                        | ((UartDev.parity & UART

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-05-25 11:26  esp8266-sniffer\
     文件        3706  2018-05-21 20:17  esp8266-sniffer\.cproject
     文件         858  2018-05-21 18:03  esp8266-sniffer\.project
     目录           0  2018-05-25 11:26  esp8266-sniffer\.settings\
     文件         106  2018-05-21 20:22  esp8266-sniffer\.settings\org.eclipse.core.resources.prefs
     目录           0  2018-05-25 11:26  esp8266-sniffer\app\
     目录           0  2018-05-25 11:26  esp8266-sniffer\app\.git\
     文件          22  2016-04-22 09:20  esp8266-sniffer\app\.gitignore
     文件          10  2016-04-22 09:32  esp8266-sniffer\app\.git\COMMIT_EDITMSG
     文件         130  2015-03-10 10:45  esp8266-sniffer\app\.git\config
     文件          73  2015-03-10 10:45  esp8266-sniffer\app\.git\description
     文件        1365  2016-04-22 09:32  esp8266-sniffer\app\.git\gitk.cache
     文件          23  2015-03-10 10:45  esp8266-sniffer\app\.git\HEAD
     目录           0  2018-05-25 11:26  esp8266-sniffer\app\.git\hooks\
     文件         452  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\applypatch-msg.sample
     文件         896  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\commit-msg.sample
     文件         160  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\post-commit.sample
     文件         552  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\post-receive.sample
     文件         189  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\post-update.sample
     文件         398  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\pre-applypatch.sample
     文件        1642  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\pre-commit.sample
     文件        1352  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\pre-push.sample
     文件        4951  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\pre-rebase.sample
     文件        1239  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\prepare-commit-msg.sample
     文件        3611  2015-03-10 10:45  esp8266-sniffer\app\.git\hooks\update.sample
     文件        6664  2016-04-22 09:20  esp8266-sniffer\app\.git\index
     目录           0  2018-05-25 11:26  esp8266-sniffer\app\.git\info\
     文件         240  2015-03-10 10:45  esp8266-sniffer\app\.git\info\exclude
     目录           0  2018-05-25 11:26  esp8266-sniffer\app\.git\logs\
     文件        4930  2016-04-22 09:32  esp8266-sniffer\app\.git\logs\HEAD
     目录           0  2018-05-21 20:16  esp8266-sniffer\app\.git\logs\refs\
............此处省略969个文件信息

评论

共有 条评论