diff --git a/rtthread_patch/SConscript b/rtthread_patch/SConscript index 01bb92a..65d32d4 100644 --- a/rtthread_patch/SConscript +++ b/rtthread_patch/SConscript @@ -7,7 +7,6 @@ src = Split(''' os/rtthread_service.c realtek/8711b/rtl8710b_startup.c realtek/8711b/app_start.c - realtek/8711b/mbed/serial_api.c realtek/common/wifi/wifi_conf.c ''') diff --git a/rtthread_patch/realtek/8711b/app_start.c b/rtthread_patch/realtek/8711b/app_start.c index e8be739..8198810 100644 --- a/rtthread_patch/realtek/8711b/app_start.c +++ b/rtthread_patch/realtek/8711b/app_start.c @@ -23,6 +23,8 @@ static rt_uint8_t main_stack[RT_MAIN_THREAD_STACK_SIZE]; struct rt_thread main_thread; #endif +extern int amebaz_wifi_start(void); + /* the system main thread */ void main_thread_entry(void *parameter) { @@ -34,6 +36,9 @@ void main_thread_entry(void *parameter) rt_components_init(); #endif + if(amebaz_wifi_start() != RT_EOK) + rt_kprintf("amebaz_wifi_start failed...\n"); + /* invoke system main function */ #if defined (__CC_ARM) $Super$$main(); /* for ARMCC. */ diff --git a/rtthread_patch/realtek/8711b/mbed/serial_api.c b/rtthread_patch/realtek/8711b/mbed/serial_api.c deleted file mode 100644 index e477fed..0000000 --- a/rtthread_patch/realtek/8711b/mbed/serial_api.c +++ /dev/null @@ -1,1502 +0,0 @@ -/** mbed Microcontroller Library - ****************************************************************************** - * @file serial_api.c - * @author - * @version V1.0.0 - * @date 2016-08-01 - * @brief This file provides mbed API for UART. - ****************************************************************************** - * @attention - * - * This module is a confidential and proprietary property of RealTek and - * possession or use of this module requires written permission of RealTek. - * - * Copyright(c) 2016, Realtek Semiconductor Corporation. All rights reserved. - ****************************************************************************** - */ -#include "objects.h" -#include "serial_api.h" -#include "serial_ex_api.h" -#include "pinmap.h" -#include - -typedef VOID (*UARTCB_FUN)(VOID *); - -typedef struct { - int TxCount; // how many byte to TX - int RxCount; // how many bytes to RX - u8 *pTxBuf; - u8 *pRxBuf; - u8 UartIndex; - - GDMA_InitTypeDef UARTTxGdmaInitStruct; - GDMA_InitTypeDef UARTRxGdmaInitStruct; - UART_InitTypeDef UART_InitStruct; - UART_TypeDef* UARTx; - IRQn_Type IrqNum; - - /* for rx DMA timeout */ - u32 last_dma_addr; - - VOID (*TxCompCallback)(VOID *para); // User Tx complete callback function - VOID (*RxCompCallback)(VOID *para); // User Rx complete callback function - VOID *TxCompCbPara; // the pointer argument for TxCompCbPara - VOID *RxCompCbPara; // the pointer argument for RxCompCallback -}MBED_UART_ADAPTER, *PMBED_UART_ADAPTER; - -#define UART_NUM (3) -#define SERIAL_TX_IRQ_EN 0x01 -#define SERIAL_RX_IRQ_EN 0x02 -#define SERIAL_TX_DMA_EN 0x01 -#define SERIAL_RX_DMA_EN 0x02 - -//#define UART_USE_GTIMER_TO 1 -#define UART_TIMER_ID 1 -#define UART_TIMER_TO 5000 - -static uint32_t serial_irq_ids[UART_NUM] = {0, 0, 0}; - -static uart_irq_handler irq_handler[UART_NUM]; -static uint32_t serial_irq_en[UART_NUM]={0, 0, 0}; - -#ifdef CONFIG_GDMA_EN -static uint32_t serial_dma_en[UART_NUM] = {0, 0, 0}; -#endif - -MBED_UART_ADAPTER uart_adapter[MAX_UART_INDEX+1]; - -#ifdef CONFIG_MBED_ENABLED -int stdio_uart_inited = 0; -serial_t stdio_uart; -#endif - -#ifdef UART_USE_GTIMER_TO -static void uart_gtimer_deinit(void); -#endif - -static const PinMap PinMap_UART_TX[] = { - {PA_4, UART_0, PIN_DATA(PullUp, PINMUX_FUNCTION_UART)}, - {PA_23, UART_0, PIN_DATA(PullUp, PINMUX_FUNCTION_UART)}, - {PA_26, UART_1, PIN_DATA(PullUp, PINMUX_FUNCTION_UART)}, - {PA_17, UART_2, PIN_DATA(PullUp, PINMUX_FUNCTION_UART)}, - {PA_30, UART_2, PIN_DATA(PullUp, PINMUX_FUNCTION_UART)}, - {NC, NC, 0} -}; - -static const PinMap PinMap_UART_RX[] = { - {PA_1, UART_0, PIN_DATA(PullUp, PINMUX_FUNCTION_UART)}, - {PA_18, UART_0, PIN_DATA(PullUp, PINMUX_FUNCTION_UART)}, - {PA_25, UART_1, PIN_DATA(PullUp, PINMUX_FUNCTION_UART)}, - {PA_16, UART_2, PIN_DATA(PullUp, PINMUX_FUNCTION_UART)}, - {PA_29, UART_2, PIN_DATA(PullUp, PINMUX_FUNCTION_UART)}, - {NC, NC, 0} -}; - -static u32 -uart_index_get(PinName tx) -{ - if ((tx == _PA_4) || (tx == _PA_23)) { - return 0; - } else if (tx == _PA_26) { - return 1; - } else if ((tx == _PA_17) || (tx == _PA_30)) { - return 2; - } else { - assert_param(0); - } - return 3; -} - -static u32 -uart_dmasend_complete( - IN VOID *Data -) -{ - PMBED_UART_ADAPTER puart_adapter = (PMBED_UART_ADAPTER) Data; - PGDMA_InitTypeDef GDMA_InitStruct; - u8 IsrTypeMap; - - puart_adapter->TxCount = 0; - - GDMA_InitStruct = &puart_adapter->UARTTxGdmaInitStruct; - - // Clean Auto Reload Bit - GDMA_ChCleanAutoReload(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, CLEAN_RELOAD_DST); - - // Clear Pending ISR - IsrTypeMap = GDMA_ClearINT(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - - /*disable UART TX DMA*/ - UART_TXDMACmd(puart_adapter->UARTx, DISABLE); - - GDMA_Cmd(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, DISABLE); - GDMA_ChnlFree(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - - UART_SetTxFlag(puart_adapter->UartIndex, 0); - - // Call user TX complete callback - if (NULL != puart_adapter->TxCompCallback) { - puart_adapter->TxCompCallback(puart_adapter->TxCompCbPara); - } - - return 0; -} - -static u32 -uart_dmarecv_complete( - IN VOID *Data -) -{ - PMBED_UART_ADAPTER puart_adapter = (PMBED_UART_ADAPTER) Data; - PGDMA_InitTypeDef GDMA_InitStruct; - u8 IsrTypeMap; - u8 LineStatus; - - GDMA_InitStruct = &puart_adapter->UARTRxGdmaInitStruct; - -#ifdef UART_USE_GTIMER_TO - RTIM_Cmd(TIMx[UART_TIMER_ID], DISABLE); - - uart_gtimer_deinit(); -#endif - - // Clean Auto Reload Bit - GDMA_ChCleanAutoReload(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, CLEAN_RELOAD_SRC); - - // Clear Pending ISR - IsrTypeMap = GDMA_ClearINT(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - - /*disable UART RX DMA*/ - UART_RXDMACmd(puart_adapter->UARTx, DISABLE); - - GDMA_Cmd(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, DISABLE); - GDMA_ChnlFree(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - - // Check the Line Status - LineStatus = (u8)UART_LineStatusGet(puart_adapter->UARTx); - - UART_SetRxFlag(puart_adapter->UartIndex, 0); - - /* close time out */ - UART_INTConfig(puart_adapter->UARTx, RUART_IER_ERBI | RUART_IER_ELSI |RUART_IER_ETOI, DISABLE); - - // Call User Rx complete callback - if (puart_adapter->RxCompCallback != NULL) { - puart_adapter->RxCompCallback (puart_adapter->RxCompCbPara); - } - - return 0; -} - -static u32 -uart_dmarecv_irqhandler( - IN VOID *Data -) -{ - PMBED_UART_ADAPTER puart_adapter = (PMBED_UART_ADAPTER) Data; - - puart_adapter->RxCount = 0; - uart_dmarecv_complete(puart_adapter); - - return 0; -} - -static void uart_txdone_callback(VOID *pAdapter) -{ - PMBED_UART_ADAPTER puart_adapter = pAdapter; - u8 uart_idx = puart_adapter->UartIndex; - - // Mask UART TX FIFI empty - UART_INTConfig(puart_adapter->UARTx, RUART_IER_ETBEI, DISABLE); - - if (irq_handler[uart_idx] != NULL) { - irq_handler[uart_idx](serial_irq_ids[uart_idx], TxIrq); - } -} - -static void uart_rxdone_callback(VOID *pAdapter) -{ - PMBED_UART_ADAPTER puart_adapter = pAdapter; - u8 uart_idx = puart_adapter->UartIndex; - - if (irq_handler[uart_idx] != NULL) { - irq_handler[uart_idx](serial_irq_ids[uart_idx], RxIrq); - } -} - -static VOID -uart_intrecv_complete( - IN PMBED_UART_ADAPTER puart_adapter - ) -{ - volatile u8 LineStatus; - - // Disable RX Interrupt - UART_INTConfig(puart_adapter->UARTx, (RUART_IER_ERBI | RUART_IER_ELSI | RUART_IER_ETOI), DISABLE); - - // Check the Line Status - LineStatus = (u8)UART_LineStatusGet(puart_adapter->UARTx); - - UART_SetRxFlag(puart_adapter->UartIndex, 0); - - // Call User Rx complete callback - if (puart_adapter->RxCompCallback != NULL) { - puart_adapter->RxCompCallback (puart_adapter->RxCompCbPara); - } -} - -static VOID -uart_intsend_complete( - IN PMBED_UART_ADAPTER puart_adapter - ) -{ - // Disable Tx FIFO empty interrupt - UART_INTConfig(puart_adapter->UARTx, RUART_IER_ETBEI, DISABLE); - - UART_SetTxFlag(puart_adapter->UartIndex, 0); - - // Call user TX complete callback - if (NULL != puart_adapter->TxCompCallback) { - puart_adapter->TxCompCallback(puart_adapter->TxCompCbPara); - } -} - -static u32 -uart_irqhandler( - IN VOID *Data -) -{ - volatile u8 reg_iir; - u8 IntId; - u32 RegValue; - PMBED_UART_ADAPTER puart_adapter = (PMBED_UART_ADAPTER) Data; - - reg_iir = UART_IntStatus(puart_adapter->UARTx); - if ((reg_iir & RUART_IIR_INT_PEND) != 0) { - // No pending IRQ - return 0; - } - - IntId = (reg_iir & RUART_IIR_INT_ID) >> 1; - - switch (IntId) { - case RUART_LP_RX_MONITOR_DONE: - RegValue = UART_LPRxMonitorSatusGet(puart_adapter->UARTx); - break; - - case RUART_MODEM_STATUS: - RegValue = UART_ModemStatusGet(puart_adapter->UARTx); - break; - - case RUART_RECEIVE_LINE_STATUS: - RegValue = UART_LineStatusGet(puart_adapter->UARTx); - break; - - case RUART_TX_FIFO_EMPTY: - if (UART_GetTxFlag(puart_adapter->UartIndex)) { - u32 TransCnt = UART_SendDataTO(puart_adapter->UARTx, puart_adapter->pTxBuf, - puart_adapter->TxCount, 1); - puart_adapter->TxCount -= TransCnt; - puart_adapter->pTxBuf += TransCnt; - - if (0 == puart_adapter->TxCount) { - uart_intsend_complete(puart_adapter); - } - } else { - // Call Tx done callback - uart_txdone_callback(puart_adapter); - } - break; - - case RUART_RECEIVER_DATA_AVAILABLE: - case RUART_TIME_OUT_INDICATION: - if (UART_GetRxFlag(puart_adapter->UartIndex) == STATERX_INT) { - u32 TransCnt = 0; - - TransCnt = UART_ReceiveDataTO(puart_adapter->UARTx, puart_adapter->pRxBuf, - puart_adapter->RxCount, 1); - puart_adapter->RxCount -= TransCnt; - puart_adapter->pRxBuf += TransCnt; - - if (puart_adapter->RxCount == 0) { - uart_intrecv_complete(puart_adapter); - } - } else { - // Call Rx data ready callback - RegValue = (UART_LineStatusGet(puart_adapter->UARTx)); - if (RegValue & RUART_LINE_STATUS_REG_DR) { - uart_rxdone_callback(puart_adapter); - } - } - break; - - default: - DBG_PRINTF(MODULE_UART, LEVEL_ERROR, "Unknown Interrupt \n"); - break; - } - - return 0; -} - -#ifdef UART_USE_GTIMER_TO -static void -uart_gtimer_handle( - IN VOID *Data -) -{ - PMBED_UART_ADAPTER puart_adapter = (PMBED_UART_ADAPTER) Data; - PGDMA_InitTypeDef GDMA_InitStruct; - u32 TransCnt = 0; - - GDMA_InitStruct = &puart_adapter->UARTRxGdmaInitStruct; - - RTIM_INTClear(TIMx[UART_TIMER_ID]); - - if (UART_GetRxFlag(puart_adapter->UartIndex) == STATERX_DMA) { - u32 Current_Addr = GDMA_GetDstAddr(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - u32 data_in_fifo = UART_Readable(puart_adapter->UARTx); - - /* have Rx some data */ - if ((Current_Addr != (u32)(puart_adapter->pRxBuf)) || data_in_fifo) { - /* not increase for 5ms */ - if (puart_adapter->last_dma_addr == Current_Addr) { - /* rx stop 5ms, packet complete */ - RTIM_Cmd(TIMx[UART_TIMER_ID], DISABLE); - - //DBG_8195A("%s:UART DMA TO Current_Addr:%x start_addr:%x RxCount: %d\n", - // __func__, Current_Addr, puart_adapter->pRxBuf, puart_adapter->RxCount); - - puart_adapter->RxCount = puart_adapter->RxCount - (Current_Addr - (u32)puart_adapter->pRxBuf); - puart_adapter->pRxBuf = (u8*)Current_Addr; - - TransCnt = UART_ReceiveDataTO(puart_adapter->UARTx, puart_adapter->pRxBuf, - puart_adapter->RxCount, 1); - puart_adapter->RxCount -= TransCnt; - puart_adapter->pRxBuf += TransCnt; - - uart_dmarecv_complete(puart_adapter); - - GDMA_Cmd(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, DISABLE); - - //DBG_8195A("UART DMA TO RxCount: %d\n", puart_adapter->RxCount); - } else { - puart_adapter->last_dma_addr = Current_Addr; - } - } else { /* rx not start */ - puart_adapter->last_dma_addr = (u32)(puart_adapter->pRxBuf); - } - } -} - - /** - * @brief Initialize the timer used for the Uart Rx Dma time out. - * @param puart_adapter: a PRUART_VERIFY_PARAMETER pointer. - * @param Period: the desired timeout value (Unit: microsecond). - * - * @retval none - */ -static void -uart_gtimer_init(PMBED_UART_ADAPTER puart_adapter, u32 PeriodUs) -{ - RTIM_TimeBaseInitTypeDef TIM_InitStructTmp; - - RTIM_TimeBaseStructInit(&TIM_InitStructTmp); - TIM_InitStructTmp.TIM_Idx = UART_TIMER_ID; - TIM_InitStructTmp.TIM_Prescaler = 0x00; - TIM_InitStructTmp.TIM_Period = (PeriodUs / 31 - 1); - TIM_InitStructTmp.TIM_UpdateEvent = ENABLE; /* UEV enable */ - TIM_InitStructTmp.TIM_UpdateSource = TIM_UpdateSource_Overflow; - TIM_InitStructTmp.TIM_ARRProtection = DISABLE; - - RTIM_TimeBaseInit(TIMx[UART_TIMER_ID], &TIM_InitStructTmp, - TIMx_irq[UART_TIMER_ID], (IRQ_FUN) uart_gtimer_handle, - (u32)puart_adapter); - RTIM_INTConfig(TIMx[UART_TIMER_ID], TIM_IT_Update, ENABLE); -} - -static void -uart_gtimer_deinit(void) -{ - InterruptDis(TIMx_irq[UART_TIMER_ID]); - InterruptUnRegister(TIMx_irq[UART_TIMER_ID]); - - RTIM_DeInit(TIMx[UART_TIMER_ID]); -} -#endif - -/** - * @brief Initializes the UART device, include clock/function/interrupt/UART registers. - * @param obj: uart object define in application software. - * @param tx: Tx PinName according to pinmux spec. - * @param rx: Rx PinName according to pinmux spec. - * @retval none - */ -void serial_init(serial_t *obj, PinName tx, PinName rx) -{ - uint8_t uart_idx = uart_index_get(tx); - UARTName uart_tx = (UARTName)pinmap_peripheral(tx, PinMap_UART_TX); - UARTName uart_rx = (UARTName)pinmap_peripheral(rx, PinMap_UART_RX); - UARTName UARTx = (UARTName)pinmap_merge(uart_tx, uart_rx); - PMBED_UART_ADAPTER puart_adapter = NULL; - - assert_param(UARTx != (UARTName)NC); - - obj->uart_idx = uart_idx; - - puart_adapter = &(uart_adapter[obj->uart_idx]); - - puart_adapter->UartIndex = uart_idx; - puart_adapter->UARTx = UART_DEV_TABLE[uart_idx].UARTx; - puart_adapter->IrqNum = UART_DEV_TABLE[uart_idx].IrqNum; - InterruptRegister((IRQ_FUN)uart_irqhandler, puart_adapter->IrqNum, (u32)puart_adapter, 10); - InterruptEn(puart_adapter->IrqNum, 10); - - /*Enable Uart Ip Clock*/ - switch (puart_adapter->UartIndex) { - case 0: - /* UART 0 */ - RCC_PeriphClockCmd(APBPeriph_UART0, APBPeriph_UART0_CLOCK, ENABLE); - break; - - case 1: - /* UART 1 */ - RCC_PeriphClockCmd(APBPeriph_UART1, APBPeriph_UART1_CLOCK, ENABLE); - break; - default: - break; - } - - /* Configure the UART pins */ - pinmap_pinout(tx, PinMap_UART_TX); - pinmap_pinout(rx, PinMap_UART_RX); - - UART_StructInit(&puart_adapter->UART_InitStruct); - UART_Init(puart_adapter->UARTx, &puart_adapter->UART_InitStruct); - -#ifdef CONFIG_MBED_ENABLED - // For stdio management - if (uart_idx == STDIO_UART) { - stdio_uart_inited = 1; - memcpy(&stdio_uart, obj, sizeof(serial_t)); - } -#endif -} - -/** - * @brief Deinitializes the UART device, include clock/function/interrupt/UART registers. - * @param obj: uart object define in application software. - * @retval none - */ -void serial_free(serial_t *obj) -{ - PMBED_UART_ADAPTER puart_adapter = &(uart_adapter[obj->uart_idx]); - - UART_DeInit(puart_adapter->UARTx); - - InterruptDis(puart_adapter->IrqNum); - InterruptUnRegister(puart_adapter->IrqNum); - -#ifdef UART_USE_GTIMER_TO - uart_gtimer_deinit(); -#endif - -#ifdef CONFIG_GDMA_EN - if (serial_dma_en[obj->uart_idx] & SERIAL_RX_DMA_EN) { - GDMA_ChnlFree(puart_adapter->UARTRxGdmaInitStruct.GDMA_Index, - puart_adapter->UARTRxGdmaInitStruct.GDMA_ChNum); - serial_dma_en[obj->uart_idx] &= ~SERIAL_RX_DMA_EN; - } - - if (serial_dma_en[obj->uart_idx] & SERIAL_TX_DMA_EN) { - GDMA_ChnlFree(puart_adapter->UARTTxGdmaInitStruct.GDMA_Index, - puart_adapter->UARTTxGdmaInitStruct.GDMA_ChNum); - serial_dma_en[obj->uart_idx] &= ~SERIAL_TX_DMA_EN; - } -#endif - // TODO: recovery Pin Mux - -} - -/** - * @brief Set UART device baudrate. - * @param obj: uart object define in application software. - * @param baudrate: Baud Rate Val, like 115200 (unit is HZ). - * @retval none - */ -void serial_baud(serial_t *obj, int baudrate) -{ - PMBED_UART_ADAPTER puart_adapter = &(uart_adapter[obj->uart_idx]); - - UART_SetBaud(puart_adapter->UARTx, baudrate); - UART_RxCmd(puart_adapter->UARTx, ENABLE); - - if (baudrate <= 500000) { - if (uart_config[obj->uart_idx].LOW_POWER_RX_ENABLE) { - LPUART_InitTypeDef LPUART_InitStruct; - - UART_LPRxpathSet(puart_adapter->UARTx, ENABLE); - UART_LPRxIPClockSet(puart_adapter->UARTx, UART_RX_CLK_OSC_8M); - UART_LPRxStructInit(&LPUART_InitStruct); - UART_LPRxInit(puart_adapter->UARTx, &LPUART_InitStruct); - UART_LPRxMonitorCmd(puart_adapter->UARTx, ENABLE); - UART_LPRxBaudSet(puart_adapter->UARTx, baudrate, OSC8M_CLOCK); - UART_LPRxCmd(puart_adapter->UARTx, ENABLE); - } - } -} - -/** - * @brief Set UART format. - * @param obj: uart object define in application software. - * @param data_bits: data bits, this parameter can be one of the following values: - * @arg 7 - * @arg 8 - * @param parity: this parameter can be one of the following values: - * @arg ParityNone - * @arg ParityOdd - * @arg ParityEven - * @arg ParityForced1: same action with ParityOdd - * @arg ParityForced0: same action with ParityEven - * @param stop_bits: this parameter can be one of the following values: - * @arg 2 - * @arg 1 - * @retval none - */ -void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits) -{ - PMBED_UART_ADAPTER puart_adapter = &(uart_adapter[obj->uart_idx]); - UART_TypeDef* UARTx = UART_DEV_TABLE[obj->uart_idx].UARTx; - - UART_RxCmd(puart_adapter->UARTx, DISABLE); - - if (data_bits == 8) { - puart_adapter->UART_InitStruct.WordLen = RUART_WLS_8BITS; - } else { - puart_adapter->UART_InitStruct.WordLen = RUART_WLS_7BITS; - } - - switch (parity) { - case ParityOdd: - case ParityForced0: - puart_adapter->UART_InitStruct.Parity = RUART_PARITY_ENABLE; - puart_adapter->UART_InitStruct.ParityType = RUART_ODD_PARITY; - break; - case ParityEven: - case ParityForced1: - puart_adapter->UART_InitStruct.Parity = RUART_PARITY_ENABLE; - puart_adapter->UART_InitStruct.ParityType = RUART_EVEN_PARITY; - break; - default: // ParityNone - puart_adapter->UART_InitStruct.Parity = RUART_PARITY_DISABLE; - break; - } - - if (stop_bits == 2) { - puart_adapter->UART_InitStruct.StopBit = RUART_STOP_BIT_2; - } else { - puart_adapter->UART_InitStruct.StopBit = RUART_STOP_BIT_1; - } - - UARTx->LCR = ((puart_adapter->UART_InitStruct.WordLen) | - (puart_adapter->UART_InitStruct.StopBit << 2) | - (puart_adapter->UART_InitStruct.Parity << 3) | - (puart_adapter->UART_InitStruct.ParityType << 4) | - (puart_adapter->UART_InitStruct.StickParity << 5)); - - UART_RxCmd(puart_adapter->UARTx, ENABLE); -} - -/** - * @brief Set UART interrupt hander if needed. - * @param obj: uart object define in application software. - * @param handler: interrupt callback function - * @param handler: interrupt callback parameter - * @retval none - */ -void serial_irq_handler(serial_t *obj, uart_irq_handler handler, uint32_t id) -{ - PMBED_UART_ADAPTER puart_adapter; - u8 uart_idx; - - puart_adapter = &(uart_adapter[obj->uart_idx]); - - uart_idx = puart_adapter->UartIndex; - - irq_handler[uart_idx] = handler; - serial_irq_ids[uart_idx] = id; -} - -/** - * @brief Enable/Disable UART interrupt. - * @param obj: uart object define in application software. - * @param irq: Tx or Rx interrupt, this parameter can be one of the following values: - * @arg RxIrq - * @arg TxIrq - * @param enable:, this parameter can be one of the following values: - * @arg 0 disable - * @arg 1 enable - * @retval none - */ -void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable) -{ - PMBED_UART_ADAPTER puart_adapter; - u8 uart_idx; - - puart_adapter = &(uart_adapter[obj->uart_idx]); - uart_idx = puart_adapter->UartIndex; - - if (enable) { - if (irq == RxIrq) { - serial_irq_en[uart_idx] |= SERIAL_RX_IRQ_EN; - UART_INTConfig(puart_adapter->UARTx, RUART_IER_ERBI | RUART_IER_ELSI | RUART_IER_ETOI, ENABLE); - } - else { - serial_irq_en[uart_idx] |= SERIAL_TX_IRQ_EN; - } - } - else { // disable - if (irq == RxIrq) { - serial_irq_en[uart_idx] &= ~SERIAL_RX_IRQ_EN; - UART_INTConfig(puart_adapter->UARTx, (RUART_IER_ERBI | RUART_IER_ELSI | RUART_IER_ETOI), DISABLE); - } - else { - serial_irq_en[uart_idx] &= ~SERIAL_TX_IRQ_EN; - UART_INTConfig(puart_adapter->UARTx, RUART_IER_ETBEI, DISABLE); - } - } -} - -/** - * @brief get one byte from UART. - * @param obj: uart object define in application software. - * @retval received data - * @note this function is asynchronous API. - */ -int serial_getc(serial_t *obj) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - u8 RxByte = 0; - - if (!serial_readable(obj)) - return -1; - UART_CharGet(puart_adapter->UARTx, &RxByte); - - return (int)RxByte; -} - -/** - * @brief send one byte use UART. - * @param obj: uart object define in application software. - * @param c: the data to transmit. - * @retval none - * @note this function is asynchronous API. - */ -void serial_putc(serial_t *obj, int c) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - - while (!serial_writable(obj)); - UART_CharPut(puart_adapter->UARTx, (c & 0xFF)); - - if (serial_irq_en[obj->uart_idx] & SERIAL_TX_IRQ_EN) { - // UnMask TX FIFO empty IRQ - UART_INTConfig(puart_adapter->UARTx, RUART_IER_ETBEI, ENABLE); - } -} - -/** - * @brief check if there is data in rx fifo. - * @param obj: uart object define in application software. - * @retval status value: - * - 1: TRUE - * - 0: FALSE - */ -int serial_readable(serial_t *obj) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - - if (UART_Readable(puart_adapter->UARTx)) { - return 1; - } else { - return 0; - } -} - -/** - * @brief check if write data to tx fifo is permitted. - * @param obj: uart object define in application software. - * @retval status value: - * - 1: TRUE - * - 0: FALSE - */ -int serial_writable(serial_t *obj) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - - if (UART_Writable(puart_adapter->UARTx)) { - return 1; - } else { - return 0; - } -} - - -/** - * @brief Clear Rx fifo. - * @param obj: uart object define in application software. - */ -void serial_clear(serial_t *obj) -{ - PMBED_UART_ADAPTER puart_adapter; - - puart_adapter = &(uart_adapter[obj->uart_idx]); - - UART_ClearRxFifo(puart_adapter->UARTx); -} - -/** - * @brief set tx pinmux. - * @param tx: Tx PinName according to pinmux spec. - */ -void serial_pinout_tx(PinName tx) -{ - Pinmux_Config(tx, PINMUX_FUNCTION_UART); -} - -/** - * @brief enable UART break contol function. - * @param obj: uart object define in application software. - */ -void serial_break_set(serial_t *obj) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - - UART_BreakCtl(puart_adapter->UARTx, 1); -} - -/** - * @brief disable UART break contol function. - * @param obj: uart object define in application software. - */ -void serial_break_clear(serial_t *obj) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - - UART_BreakCtl(puart_adapter->UARTx, 0); -} - -/** - * @brief set TX complete handler. - * @param obj: uart object define in application software. - * @param handler: TX complete callback function. - * @param id: TX complete callback function parameter. - * @retval none - * @note this function is used when asynchronous API is used. - */ -void serial_send_comp_handler(serial_t *obj, void *handler, uint32_t id) -{ - PMBED_UART_ADAPTER puart_adapter; - - puart_adapter = &(uart_adapter[obj->uart_idx]); - puart_adapter->TxCompCallback = (UARTCB_FUN)handler; - puart_adapter->TxCompCbPara = (void*)id; -} - -/** - * @brief set RX complete handler. - * @param obj: uart object define in application software. - * @param handler: RX complete callback function. - * @param id: RX complete callback function parameter. - * @retval none - * @note this function is used when asynchronous API is used. - */ -void serial_recv_comp_handler(serial_t *obj, void *handler, uint32_t id) -{ - PMBED_UART_ADAPTER puart_adapter; - - puart_adapter = &(uart_adapter[obj->uart_idx]); - puart_adapter->RxCompCallback = (UARTCB_FUN)handler; - puart_adapter->RxCompCbPara = (void*)id; -} - -/** - * @brief recv target length data use interrupt mode. - * @param obj: uart object define in application software. - * @param prxbuf: buffer to save data read from UART FIFO. - * @param len: number of data to be read. - * @retval HAL_Status - * @note this function is asynchronous API. - */ -int32_t serial_recv_stream (serial_t *obj, char *prxbuf, uint32_t len) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - int ret = HAL_OK; - u32 TransCnt = 0; - - assert_param(prxbuf != NULL); - assert_param(len != 0); - - if (UART_GetRxFlag(puart_adapter->UartIndex)) { - DBG_PRINTF(MODULE_UART, LEVEL_WARN, "uart int rx: busy\n"); - return HAL_BUSY; - } - - obj->rx_len = len; - puart_adapter->pRxBuf = (uint8_t*)prxbuf; - puart_adapter->RxCount = len; - - UART_SetRxFlag(puart_adapter->UartIndex, STATERX_INT); - - // Could be the RX FIFO has some data already - TransCnt = UART_ReceiveDataTO(puart_adapter->UARTx, puart_adapter->pRxBuf, - puart_adapter->RxCount, 1); - puart_adapter->RxCount -= TransCnt; - puart_adapter->pRxBuf += TransCnt; - - if (puart_adapter->RxCount == 0) { - uart_intrecv_complete(puart_adapter); - } else { - // Enable RX Interrupt - UART_INTConfig(puart_adapter->UARTx, RUART_IER_ERBI | RUART_IER_ELSI | RUART_IER_ETOI, ENABLE); - } - - return (ret); -} - -/** - * @brief send target length data use interrupt mode. - * @param obj: uart object define in application software. - * @param ptxbuf: buffer to be written to Tx FIFO. - * @param len: number of data to be send. - * @retval HAL_Status - * @note this function is asynchronous API. - */ -int32_t serial_send_stream (serial_t *obj, char *ptxbuf, uint32_t len) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - int ret = 0; - u32 TransCnt = 0; - - assert_param(ptxbuf != NULL); - assert_param(len != 0); - - if (UART_GetTxFlag(puart_adapter->UartIndex)) { - DBG_PRINTF(MODULE_UART, LEVEL_WARN, "uart int tx: busy\n"); - return HAL_BUSY; - } - - obj->tx_len = len; - puart_adapter->pTxBuf = (uint8_t*)ptxbuf; - puart_adapter->TxCount = len; - - UART_SetTxFlag(puart_adapter->UartIndex, STATETX_INT); - - TransCnt = UART_SendDataTO(puart_adapter->UARTx, puart_adapter->pTxBuf, - puart_adapter->TxCount, 1); - puart_adapter->TxCount -= TransCnt; - puart_adapter->pTxBuf += TransCnt; - - if (0 == puart_adapter->TxCount) { - uart_intsend_complete(puart_adapter); - } else { - // Enable Tx FIFO empty interrupt - UART_INTConfig(puart_adapter->UARTx, RUART_IER_ETBEI, ENABLE); - } - - return (ret); -} - -/** - * @brief recv target length data use DMA mode. - * @param obj: uart object define in application software. - * @param prxbuf: buffer to save data read from UART FIFO. - * @param len: number of data to be read. - * @retval HAL_Status - * @note this function is asynchronous API. - */ -int32_t serial_recv_stream_dma (serial_t *obj, char *prxbuf, uint32_t len) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - HAL_Status ret = HAL_OK; - u32 ret1; - - if (uart_config[obj->uart_idx].LOW_POWER_RX_ENABLE) { - return serial_recv_stream (obj, prxbuf, len); - } - - //ret = HalRuartRecv(puart_adapter, (u8*)prxbuf, len, DMA_BASED); - - assert_param(prxbuf != NULL); - assert_param(len != 0); - - if (UART_GetRxFlag(puart_adapter->UartIndex)) { - DBG_PRINTF(MODULE_UART, LEVEL_WARN, "uart dma rx: busy\n"); - return HAL_BUSY; - } - - obj->rx_len = len; - puart_adapter->pRxBuf = (uint8_t*)prxbuf; - puart_adapter->RxCount = len; - puart_adapter->last_dma_addr = (u32)prxbuf; - - UART_SetRxFlag(puart_adapter->UartIndex, STATERX_DMA); - - // Disable Rx interrupt - UART_INTConfig(puart_adapter->UARTx, (RUART_IER_ERBI | RUART_IER_ELSI | RUART_IER_ETOI), DISABLE); - UART_RXDMAConfig(puart_adapter->UARTx, 4); - UART_RXDMACmd(puart_adapter->UARTx, ENABLE); - - ret1 = UART_RXGDMA_Init(puart_adapter->UartIndex, &puart_adapter->UARTRxGdmaInitStruct, - puart_adapter, uart_dmarecv_irqhandler, - puart_adapter->pRxBuf, puart_adapter->RxCount); - - if ((serial_dma_en[obj->uart_idx] & SERIAL_RX_DMA_EN)==0) { - if(ret1 == _TRUE) { - serial_dma_en[obj->uart_idx] |= SERIAL_RX_DMA_EN; - } else { - return HAL_BUSY; - } - } - - #ifdef UART_USE_GTIMER_TO - uart_gtimer_init(puart_adapter, UART_TIMER_TO); - RTIM_Cmd(TIMx[UART_TIMER_ID], ENABLE); - #endif - - return (ret); -} - -/** - * @brief send target length data use DMA mode. - * @param obj: uart object define in application software. - * @param ptxbuf: buffer to be written to Tx FIFO. - * @param len: number of data to be send. - * @retval HAL_Status - * @note this function is asynchronous API. - */ -int32_t serial_send_stream_dma (serial_t *obj, char *ptxbuf, uint32_t len) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - int32_t ret = HAL_OK; - u32 ret1; - - if (uart_config[obj->uart_idx].LOW_POWER_RX_ENABLE) { - return serial_send_stream (obj, ptxbuf, len); - } - - assert_param(ptxbuf != NULL); - assert_param(len != 0); - - if (UART_GetTxFlag(puart_adapter->UartIndex)) { - DBG_PRINTF(MODULE_UART, LEVEL_WARN, "uart dma tx: busy\n"); - return HAL_BUSY; - } - - obj->tx_len = len; - puart_adapter->pTxBuf = (uint8_t*)ptxbuf; - puart_adapter->TxCount = len; - - UART_SetTxFlag(puart_adapter->UartIndex, STATETX_DMA); - - UART_TXDMAConfig(puart_adapter->UARTx, 8); - UART_TXDMACmd(puart_adapter->UARTx, ENABLE); - - ret1 = UART_TXGDMA_Init(puart_adapter->UartIndex, &puart_adapter->UARTTxGdmaInitStruct, - puart_adapter, uart_dmasend_complete, - puart_adapter->pTxBuf, puart_adapter->TxCount); - - if ((serial_dma_en[obj->uart_idx] & SERIAL_TX_DMA_EN)==0) { - if(ret1 == _TRUE) { - serial_dma_en[obj->uart_idx] |= SERIAL_TX_DMA_EN; - } else { - return HAL_BUSY; - } - } - - return (ret); -} - -/** - * @brief stop the sream or steam_dma RX. - * @param obj: uart object define in application software. - */ -int32_t serial_send_stream_abort (serial_t *obj) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - int ret = 0; - - if (!UART_GetTxFlag(puart_adapter->UartIndex)) { - //DBG_PRINTF(MODULE_UART, LEVEL_WARN, "uart tx abort: Not in TX state \n"); - return HAL_OK; - } - - // Disable Tx FIFO empty interrupt - UART_INTConfig(puart_adapter->UARTx, RUART_IER_ETBEI, DISABLE); - - if(UART_GetTxFlag(puart_adapter->UartIndex) == STATERX_DMA) { - if (uart_config[obj->uart_idx].LOW_POWER_RX_ENABLE == DISABLE) { - u32 Current_Addr; - PGDMA_InitTypeDef GDMA_InitStruct = &puart_adapter->UARTTxGdmaInitStruct; - u8 IsrTypeMap; - - Current_Addr = GDMA_GetSrcAddr(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - GDMA_Cmd(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, DISABLE); - - puart_adapter->TxCount = puart_adapter->TxCount - (Current_Addr - (u32)puart_adapter->pTxBuf); - puart_adapter->pTxBuf = (u8*)Current_Addr; - - // Clean Auto Reload Bit - GDMA_ChCleanAutoReload(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, CLEAN_RELOAD_DST); - // Clear Pending ISR - IsrTypeMap = GDMA_ClearINT(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - //GDMA_Cmd(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, DISABLE); - GDMA_ChnlFree(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - - UART_TXDMACmd(puart_adapter->UARTx, DISABLE); - } - } - - UART_SetTxFlag(puart_adapter->UartIndex, 0); - - UART_ClearTxFifo(puart_adapter->UARTx); - - ret = obj->tx_len - puart_adapter->TxCount; - - return (ret); -} - -/** - * @brief stop the sream or steam_dma TX. - * @param obj: uart object define in application software. - */ -int32_t serial_recv_stream_abort (serial_t *obj) -{ - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - int ret = 0; - - if (!UART_GetRxFlag(puart_adapter->UartIndex)) { - //DBG_PRINTF(MODULE_UART, LEVEL_WARN, "uart rx abort: Not in TX state \n"); - return HAL_OK; - } - - // Disable Rx interrupt - UART_INTConfig(puart_adapter->UARTx, (RUART_IER_ERBI | RUART_IER_ELSI | RUART_IER_ETOI), DISABLE); - - if(UART_GetRxFlag(puart_adapter->UartIndex) == STATERX_DMA) { - if (uart_config[obj->uart_idx].LOW_POWER_RX_ENABLE == DISABLE) { - u32 Current_Addr; - u32 TransCnt; - PGDMA_InitTypeDef GDMA_InitStruct = &puart_adapter->UARTRxGdmaInitStruct; - u8 IsrTypeMap; - - /*when stream DMA mode used, some data may be in uart rx fifo, get it if transmission aborted*/ - Current_Addr = GDMA_GetDstAddr(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - GDMA_Cmd(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, DISABLE); - - puart_adapter->RxCount = puart_adapter->RxCount - (Current_Addr - (u32)puart_adapter->pRxBuf); - puart_adapter->pRxBuf = (u8*)Current_Addr; - - TransCnt = UART_ReceiveDataTO(puart_adapter->UARTx, puart_adapter->pRxBuf, - puart_adapter->RxCount, 1); - puart_adapter->RxCount -= TransCnt; - puart_adapter->pRxBuf += TransCnt; - - // Clean Auto Reload Bit - GDMA_ChCleanAutoReload(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, CLEAN_RELOAD_DST); - // Clear Pending ISR - IsrTypeMap = GDMA_ClearINT(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - //GDMA_Cmd(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, DISABLE); - GDMA_ChnlFree(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum); - UART_RXDMACmd(puart_adapter->UARTx, DISABLE); - } - } - - UART_SetRxFlag(puart_adapter->UartIndex, 0); - - UART_ClearRxFifo(puart_adapter->UARTx); - - ret = obj->rx_len - puart_adapter->RxCount; - - return (ret); -} - -/** - * @brief Clear TX fifo. - * @param obj: uart object define in application software. - */ -void serial_clear_tx(serial_t *obj) -{ - UART_TypeDef* UARTx = UART_DEV_TABLE[obj->uart_idx].UARTx; - - UART_ClearTxFifo(UARTx); -} - -/** - * @brief Clear RX fifo. - * @param obj: uart object define in application software. - */ -void serial_clear_rx(serial_t *obj) -{ - UART_TypeDef* UARTx = UART_DEV_TABLE[obj->uart_idx].UARTx; - - UART_ClearRxFifo(UARTx); -} - -/** - * @brief recv target length data use poll mode, with time out. - * @param obj: uart object define in application software. - * @param ptxbuf: buffer to be written to Tx FIFO. - * @param len: number of data to be recv. - * @param timeout_ms: polling time before timeout. - * @retval return received bytes count - * @note this function is synchronous API. - */ -int32_t serial_recv_blocked (serial_t *obj, char *prxbuf, uint32_t len, uint32_t timeout_ms) -{ - UART_TypeDef* UARTx = UART_DEV_TABLE[obj->uart_idx].UARTx; - uint32_t cnt = 0; - uint32_t startcount = SYSTIMER_TickGet(); - - obj->rx_len = len; - while (1) { - while (!serial_readable(obj)); - UART_CharGet(UARTx, prxbuf); - - prxbuf++; - cnt++; - - if (cnt == len) { - break; - } - - if (SYSTIMER_GetPassTime(startcount) > timeout_ms) { - break; - } - } - - return cnt; -} - -/** - * @brief send target length data use poll mode, with time out. - * @param obj: uart object define in application software. - * @param ptxbuf: buffer to be written to Tx FIFO. - * @param len: number of data to be send. - * @param timeout_ms: polling time before timeout. - * @retval transmitted bytes count - * @note this function is synchronous API. - */ -int32_t serial_send_blocked (serial_t *obj, char *ptxbuf, uint32_t len, uint32_t timeout_ms) -{ - UART_TypeDef* UARTx = UART_DEV_TABLE[obj->uart_idx].UARTx; - uint32_t cnt = 0; - uint32_t startcount = SYSTIMER_TickGet(); - - obj->tx_len = len; - while (1) { - while (!serial_writable(obj)); - UART_CharPut(UARTx, *ptxbuf); - - ptxbuf++; - cnt++; - - if (cnt == len) { - break; - } - - if (SYSTIMER_GetPassTime(startcount) > timeout_ms) { - break; - } - } - - return cnt; -} - -/** - * @brief disable uart clock and function. - * @retval none - */ -void serial_disable (serial_t *obj) -{ - switch (obj->uart_idx) { - case 0: - /* UART 0 */ - RCC_PeriphClockCmd(APBPeriph_UART0, APBPeriph_UART0_CLOCK, DISABLE); - break; - - case 1: - /* UART 1 */ - RCC_PeriphClockCmd(APBPeriph_UART1, APBPeriph_UART1_CLOCK, DISABLE); - break; - default: - break; - } - -} - -/** - * @brief enable uart clock and function. - * @retval none - */ -void serial_enable (serial_t *obj) -{ - switch (obj->uart_idx) { - case 0: - /* UART 0 */ - RCC_PeriphClockCmd(APBPeriph_UART0, APBPeriph_UART0_CLOCK, ENABLE); - break; - - case 1: - /* UART 1 */ - RCC_PeriphClockCmd(APBPeriph_UART1, APBPeriph_UART1_CLOCK, ENABLE); - break; - default: - break; - } -} - - -/** - * @brief send target length data use interrupt mode. - * @param obj: uart object define in application software. - * @param ptxbuf: buffer to be written to Tx FIFO. - * @param len: number of data to be recv. - * @retval the byte count received before timeout, or error(<0) - * @note this function is asynchronous API. - */ -int32_t serial_recv_stream_timeout (serial_t *obj, - char *prxbuf, - uint32_t len, - uint32_t timeout_ms, - void *force_cs) -{ - UART_TypeDef* UARTx = UART_DEV_TABLE[obj->uart_idx].UARTx; - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - u32 TransCnt = 0; - void (*task_yield)(void); - uint32_t startcount = SYSTIMER_TickGet(); - - assert_param(prxbuf != NULL); - assert_param(len != 0); - assert_param(timeout_ms > 0); - - //ret = HalRuartRecv(puart_adapter, (u8*)prxbuf, len, INT_BASED); - - if (UART_GetRxFlag(obj->uart_idx)) { - DBG_PRINTF(MODULE_UART, LEVEL_WARN, "uart int rx: busy\n"); - return -1; - } - - puart_adapter->pRxBuf = (uint8_t*)prxbuf; - puart_adapter->RxCount = len; - - UART_SetRxFlag(obj->uart_idx, STATERX_INT); - - // Could be the RX FIFO has some data already - TransCnt = UART_ReceiveDataTO(UARTx, puart_adapter->pRxBuf, - puart_adapter->RxCount, 1); - puart_adapter->RxCount -= TransCnt; - puart_adapter->pRxBuf += TransCnt; - - if (puart_adapter->RxCount == 0) { - uart_intrecv_complete(puart_adapter); - return len; - } else { - // Enable RX Interrupt - UART_INTConfig(UARTx, RUART_IER_ERBI | RUART_IER_ELSI | RUART_IER_ETOI, ENABLE); - } - - if (puart_adapter->RxCount > 0) { - task_yield = (void (*)(void))force_cs; - while (1) { - /* complete */ - if (UART_GetRxFlag(obj->uart_idx) != STATERX_INT) { - break; - } - - /* time out */ - if (SYSTIMER_GetPassTime(startcount) > timeout_ms) { - serial_recv_stream_abort(obj); - } - - if (NULL != task_yield) { - task_yield(); - } - } - } - - return (len - puart_adapter->RxCount); -} - -/** - * @brief send target length data use DMA mode. - * @param obj: uart object define in application software. - * @param ptxbuf: buffer to be written to Tx FIFO. - * @param len: number of data to be recv. - * @retval the byte count received before timeout, or error(<0) - * @note this function is asynchronous API. - */ -int32_t serial_recv_stream_dma_timeout (serial_t *obj, - char *prxbuf, - uint32_t len, - uint32_t timeout_ms, - void *force_cs) -{ - UART_TypeDef* UARTx = UART_DEV_TABLE[obj->uart_idx].UARTx; - PMBED_UART_ADAPTER puart_adapter=&(uart_adapter[obj->uart_idx]); - void (*task_yield)(void); - uint32_t startcount = SYSTIMER_TickGet(); - u32 ret1; - - if (uart_config[obj->uart_idx].LOW_POWER_RX_ENABLE) { - return serial_recv_stream_timeout (obj, prxbuf, len, timeout_ms, force_cs); - } - - assert_param(prxbuf != NULL); - assert_param(len != 0); - assert_param(timeout_ms > 0); - - if (UART_GetRxFlag(puart_adapter->UartIndex)) { - DBG_PRINTF(MODULE_UART, LEVEL_WARN, "uart dma rx: busy\n"); - return -1; - } - - puart_adapter->pRxBuf = (u8*)prxbuf; - puart_adapter->RxCount = len; - puart_adapter->last_dma_addr = (u32)prxbuf; - - UART_SetRxFlag(puart_adapter->UartIndex, STATERX_DMA); - - // Disable Rx interrupt - UART_INTConfig(puart_adapter->UARTx, (RUART_IER_ERBI | RUART_IER_ELSI | RUART_IER_ETOI), DISABLE); - UART_RXDMAConfig(puart_adapter->UARTx, 4); - UART_RXDMACmd(puart_adapter->UARTx, ENABLE); - - ret1 = UART_RXGDMA_Init(puart_adapter->UartIndex, &puart_adapter->UARTRxGdmaInitStruct, - puart_adapter, uart_dmarecv_irqhandler, - puart_adapter->pRxBuf, puart_adapter->RxCount); - - if ((serial_dma_en[obj->uart_idx] & SERIAL_RX_DMA_EN)==0) { - if(ret1 == _TRUE) { - serial_dma_en[obj->uart_idx] |= SERIAL_RX_DMA_EN; - } else { - return -1; - } - } - - if (puart_adapter->RxCount > 0) { - task_yield = (void (*)(void))force_cs; - while (1) { - /* complete */ - if (UART_GetRxFlag(obj->uart_idx) != STATERX_DMA) { - break; - } - - /* time out */ - if (SYSTIMER_GetPassTime(startcount) > timeout_ms) { - uint32_t current_dst_addr = GDMA_GetDstAddr(puart_adapter->UARTRxGdmaInitStruct.GDMA_Index, - puart_adapter->UARTRxGdmaInitStruct.GDMA_ChNum); - uint32_t data_in_fifo = UART_Readable(puart_adapter->UARTx); - uint32_t trans_cnt = 0; - - /* have Rx some data */ - if ((current_dst_addr != (u32)(puart_adapter->pRxBuf)) || data_in_fifo) { - puart_adapter->RxCount = puart_adapter->RxCount - (current_dst_addr - (u32)puart_adapter->pRxBuf); - puart_adapter->pRxBuf = (u8*)current_dst_addr; - - trans_cnt = UART_ReceiveDataTO(puart_adapter->UARTx, puart_adapter->pRxBuf, - puart_adapter->RxCount, 1); - puart_adapter->RxCount -= trans_cnt; - puart_adapter->pRxBuf += trans_cnt; - } - - uart_dmarecv_complete(puart_adapter); - - break; - } - - if (NULL != task_yield) { - task_yield(); - } - } - } - return (len - puart_adapter->RxCount); -} - -/** - * @brief set uart rx fifo trigger level. - * @param obj: uart object define in application software. - * @param FifoLv: FIFO level enum index. - * @retval none - */ -void serial_rx_fifo_level(serial_t *obj, SerialFifoLevel FifoLv) -{ - UART_TypeDef* UARTx = UART_DEV_TABLE[obj->uart_idx].UARTx; - u32 Temp; - - switch(FifoLv) { - case FifoLv1Byte: - Temp = UART_RX_FIFOTRIG_LEVEL_1BYTES; - break; - case FifoLvQuarter: - Temp = UART_RX_FIFOTRIG_LEVEL_4BYTES; - break; - case FifoLvHalf: - Temp = UART_RX_FIFOTRIG_LEVEL_8BYTES; - break; - case FifoLvFull: - Temp = UART_RX_FIFOTRIG_LEVEL_14BYTES; - break; - default: - assert_param(0); - break; - } - - /*set rx fifo level*/ - UART_SetRxLevel(UARTx, Temp); -} - -/** - * @brief uart autoflow contol setting. - * @param obj: uart object define in application software. - * @param type: autoflow control type. - * @param rxflow: RTS pin. - * @param txflow: CTS pin. - * @retval none - */ -void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow) -{ - - UART_TypeDef* UARTx = UART_DEV_TABLE[obj->uart_idx].UARTx; - - /*Only UART0 supports auto flow control in AmebaZ*/ - assert_param(obj->uart_idx == 0); - - /*autoflow control configuration*/ - if(type != FlowControlNone) { - /*config UART0 pinmux*/ - if(rxflow == PA_3) { - /*UART0 "S0" */ - Pinmux_Config(_PA_3, PINMUX_FUNCTION_UART); /*RTS*/ - Pinmux_Config(_PA_2, PINMUX_FUNCTION_UART); /*CTS*/ - } else if (rxflow == PA_22) { - /*UART0 "S1" */ - Pinmux_Config(_PA_22, PINMUX_FUNCTION_UART); /*RTS*/ - Pinmux_Config(_PA_19, PINMUX_FUNCTION_UART); /*CTS*/ - } else { - assert_param(0); - } - /*enable auto flow control*/ - UARTx->MCR |= BIT(5); - } else { - /*disable auto flow control*/ - UARTx->MCR &= ~ BIT(5); - } - - /*no matter auto flow control is enabled or disabled, - RTS pin should be always Low, and thus peer can send data*/ - UARTx->MCR |= BIT(1); - -} - -/******************* (C) COPYRIGHT 2016 Realtek Semiconductor *****END OF FILE****/ diff --git a/rtthread_patch/realtek/common/wifi/wifi_conf.c b/rtthread_patch/realtek/common/wifi/wifi_conf.c index 690bfb1..ba0971b 100644 --- a/rtthread_patch/realtek/common/wifi/wifi_conf.c +++ b/rtthread_patch/realtek/common/wifi/wifi_conf.c @@ -1825,6 +1825,10 @@ void wifi_autoreconnect_hdl(rtw_security_t security_type, param.password_len = password_len; param.key_id = key_id; // xTaskCreate(wifi_autoreconnect_thread, (const char *)"wifi_autoreconnect", 512, ¶m, tskIDLE_PRIORITY + 1, NULL); + +// rt_thread_t tid = rt_thread_create("autoconn", wifi_autoreconnect_thread, ¶m, 2048, RT_THREAD_PRIORITY_MAX - 2, 20); +// if(tid != RT_NULL) +// rt_thread_startup(tid); } int wifi_config_autoreconnect(__u8 mode, __u8 retry_times, __u16 timeout) diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/SConscript b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/SConscript index 015874f..0c93fca 100644 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/SConscript +++ b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/component/common/mbed/SConscript @@ -21,6 +21,7 @@ targets/hal/rtl8711b/pinmap_common.c targets/hal/rtl8711b/port_api.c targets/hal/rtl8711b/pwmout_api.c targets/hal/rtl8711b/rtc_api.c +targets/hal/rtl8711b/serial_api.c targets/hal/rtl8711b/sleep.c targets/hal/rtl8711b/spi_api.c targets/hal/rtl8711b/sys_api.c diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/ChangeLog b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/ChangeLog deleted file mode 100644 index 6b9f3d9..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/ChangeLog +++ /dev/null @@ -1,64 +0,0 @@ - ChangeLog ----------------------------------------------------------------- -2016/10/06 - -Refined soft AP SSID - -2016/08/30 - -Refined security with soft AP - -2016/08/10 - -Refined simple config flow with soft AP - -2016/05/23 - -Refined simple config flow with PIN code - -2016/05/03 - -Refined simple config flow - -2016/02/22 - - Support multiple device - - Scan flow refined after configuration - -2016/01/21 - - Connection issue fixed when AP is hidden SSID - -2016/01/10 - - Fixed ssid is empty when AP is hidden SSID - -2015/11/11 - - Refined wifi connection - -2015/09/25 - - Refined SimpleConfig ap list and wifi connection - -2015/08/15 - - Refined simple config - -2015/07/23 - - device type : 0xff00~0xffff for customer - -2015/04/22 - - Show one AP of the same SSID multiple APs on AP List by site survey - -2015/02/11 - - Bug fixed: Reconnection WiFi AP issue. - - Bug fixed: Type transformation for Encryption WiFi profile. - - Re-fine time interval(ms) between sending two packets - -2014/10/20 - - Re-fine configure flow when DUT receives first UDP packet. - -2014/10/01 - - Refined if the profile length>127, configure will fail issue. - -2014/08/13 - - Add Hidden SSID Support - -2014/08/04 - - Re-fine configure flow - - Re-fine control flow - - Re-fine discovery flow - - Add descriptions of the delay about sending packet - -2014/06/19 - - Initial Release \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3.0.3.20170222.apk b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3.0.3.20170222.apk deleted file mode 100644 index d1e85d0..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3.0.3.20170222.apk and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/.classpath b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/.classpath deleted file mode 100644 index 5176974..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/.project b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/.project deleted file mode 100644 index e97fa78..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - SimpleConfigWizard_R3 - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/.settings/org.eclipse.jdt.core.prefs b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b080d2d..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/AndroidManifest.xml b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/AndroidManifest.xml deleted file mode 100644 index 88da713..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/AndroidManifest.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/AndroidManifest.xml b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/AndroidManifest.xml deleted file mode 100644 index 88da713..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/AndroidManifest.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/SimpleConfigWizard_R3.apk b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/SimpleConfigWizard_R3.apk deleted file mode 100644 index d1e85d0..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/SimpleConfigWizard_R3.apk and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/classes.dex b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/classes.dex deleted file mode 100644 index 6fb9273..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/classes.dex and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/android-support-v4-0e27d4152ed4b508fca4a09f81fb0f8e.jar b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/android-support-v4-0e27d4152ed4b508fca4a09f81fb0f8e.jar deleted file mode 100644 index 6a3b86b..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/android-support-v4-0e27d4152ed4b508fca4a09f81fb0f8e.jar and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/gson-2.2.1-697a0098066e7fee622bd16b9e5a1fbd.jar b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/gson-2.2.1-697a0098066e7fee622bd16b9e5a1fbd.jar deleted file mode 100644 index a90e209..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/gson-2.2.1-697a0098066e7fee622bd16b9e5a1fbd.jar and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/simpleconfigwizard_r3_lib-1c2ee117da350b18bdce28ca37ce5c65.jar b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/simpleconfigwizard_r3_lib-1c2ee117da350b18bdce28ca37ce5c65.jar deleted file mode 100644 index ee91461..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/simpleconfigwizard_r3_lib-1c2ee117da350b18bdce28ca37ce5c65.jar and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/zxing-5d39dab804ff2d89b29a3ca1f8dc9087.jar b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/zxing-5d39dab804ff2d89b29a3ca1f8dc9087.jar deleted file mode 100644 index 8e4587c..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/dexedLibs/zxing-5d39dab804ff2d89b29a3ca1f8dc9087.jar and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-hdpi/ic_launcher.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-hdpi/ic_launcher.png deleted file mode 100644 index efa7c5f..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-mdpi/ic_launcher.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-mdpi/ic_launcher.png deleted file mode 100644 index ec27f2e..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-xhdpi/ic_launcher.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 92fc57d..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-xxhdpi/ic_launcher.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index b6f8f4e..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/add_icon.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/add_icon.png deleted file mode 100644 index 629cc5b..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/add_icon.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/ic_dialog_icon.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/ic_dialog_icon.png deleted file mode 100644 index 5b5add5..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/ic_dialog_icon.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/icon.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/icon.png deleted file mode 100644 index cf78585..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/icon.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/info.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/info.png deleted file mode 100644 index 057d063..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/info.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/pin_code_disable.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/pin_code_disable.png deleted file mode 100644 index e5efffe..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/pin_code_disable.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/pin_code_enable.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/pin_code_enable.png deleted file mode 100644 index 4206b5d..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/pin_code_enable.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/qrcode_img.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/qrcode_img.png deleted file mode 100644 index 148577f..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/qrcode_img.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/refresh.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/refresh.png deleted file mode 100644 index 9f30dc9..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/refresh.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/refresh1.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/refresh1.png deleted file mode 100644 index 9bf4c10..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/refresh1.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/settings.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/settings.png deleted file mode 100644 index 73c21f3..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/settings.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/settings_icon.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/settings_icon.png deleted file mode 100644 index 24de611..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/settings_icon.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal1.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal1.png deleted file mode 100644 index deb58b6..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal1.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal2.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal2.png deleted file mode 100644 index 599b173..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal2.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal3.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal3.png deleted file mode 100644 index 7bd1cbf..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal3.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal4.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal4.png deleted file mode 100644 index 02441d7..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal4.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal5.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal5.png deleted file mode 100644 index bbdcdce..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/signal5.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/speaker.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/speaker.png deleted file mode 100644 index a4d3249..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/res/crunch/drawable/speaker.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/resources.ap_ b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/resources.ap_ deleted file mode 100644 index 800c7bb..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/bin/resources.ap_ and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/gen/com/rtk/simpleconfig_wizard/BuildConfig.java b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/gen/com/rtk/simpleconfig_wizard/BuildConfig.java deleted file mode 100644 index 47bad59..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/gen/com/rtk/simpleconfig_wizard/BuildConfig.java +++ /dev/null @@ -1,6 +0,0 @@ -/** Automatically generated file. DO NOT MODIFY */ -package com.rtk.simpleconfig_wizard; - -public final class BuildConfig { - public final static boolean DEBUG = true; -} \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/gen/com/rtk/simpleconfig_wizard/R.java b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/gen/com/rtk/simpleconfig_wizard/R.java deleted file mode 100644 index 234bbc5..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/gen/com/rtk/simpleconfig_wizard/R.java +++ /dev/null @@ -1,297 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.rtk.simpleconfig_wizard; - -public final class R { - public static final class attr { - } - public static final class color { - public static final int bg_color=0x7f050002; - public static final int buttons_view_bk=0x7f050000; - public static final int color_tiffany=0x7f05001d; - public static final int content_bk=0x7f050001; - public static final int contents_text=0x7f050003; - public static final int encode_view=0x7f050004; - public static final int grgray=0x7f05001c; - public static final int header=0x7f05001b; - public static final int help_button_view=0x7f050005; - public static final int help_view=0x7f050006; - public static final int possible_result_points=0x7f050007; - public static final int result_image_border=0x7f050008; - public static final int result_minor_text=0x7f050009; - public static final int result_points=0x7f05000a; - public static final int result_text=0x7f05000b; - public static final int result_view=0x7f05000c; - public static final int sbc_header_text=0x7f05000d; - public static final int sbc_header_view=0x7f05000e; - public static final int sbc_layout_view=0x7f050010; - public static final int sbc_list_item=0x7f05000f; - public static final int sbc_page_number_text=0x7f050011; - public static final int sbc_snippet_text=0x7f050012; - public static final int share_text=0x7f050013; - public static final int share_view=0x7f050014; - public static final int status_text=0x7f050016; - public static final int status_view=0x7f050015; - public static final int transparent=0x7f050017; - public static final int viewfinder_frame=0x7f050018; - public static final int viewfinder_laser=0x7f050019; - public static final int viewfinder_mask=0x7f05001a; - } - public static final class dimen { - /** Default screen margins, per the Android Design guidelines. - - Customize dimensions originally defined in res/values/dimens.xml (such as - screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. - - */ - public static final int activity_horizontal_margin=0x7f060000; - public static final int activity_vertical_margin=0x7f060001; - } - public static final class drawable { - public static final int add_icon=0x7f020000; - public static final int background_scrollview=0x7f020001; - public static final int btn_new_device=0x7f020002; - public static final int ic_dialog_icon=0x7f020003; - public static final int ic_launcher=0x7f020004; - public static final int icon=0x7f020005; - public static final int info=0x7f020006; - public static final int navbar=0x7f020007; - public static final int pin_code_disable=0x7f020008; - public static final int pin_code_enable=0x7f020009; - public static final int qrcode_img=0x7f02000a; - public static final int refresh=0x7f02000b; - public static final int refresh1=0x7f02000c; - public static final int settings=0x7f02000d; - public static final int settings_icon=0x7f02000e; - public static final int signal1=0x7f02000f; - public static final int signal2=0x7f020010; - public static final int signal3=0x7f020011; - public static final int signal4=0x7f020012; - public static final int signal5=0x7f020013; - public static final int speaker=0x7f020014; - } - public static final class id { - public static final int IPAddress=0x7f070022; - public static final int IPAddress_TextView=0x7f070023; - public static final int LinkSpeed_TextView=0x7f07001f; - public static final int Password=0x7f070024; - public static final int Password_EditText=0x7f070026; - public static final int Password_TextView=0x7f070025; - public static final int Security_TextView=0x7f070021; - public static final int ShowPassword_CheckBox=0x7f070027; - public static final int SignalStrength_TextView=0x7f070020; - public static final int Speed=0x7f07001e; - public static final int Status=0x7f07001c; - public static final int Status_TextView=0x7f07001d; - public static final int action_settings=0x7f070041; - public static final int addNewNetworkBtn=0x7f070032; - public static final int add_network_dialog=0x7f070017; - /** Messages IDs - */ - public static final int auto_focus=0x7f070000; - public static final int btn_cancel_scan=0x7f07003c; - public static final int btn_configNewDevice=0x7f070016; - public static final int btn_info=0x7f070010; - public static final int btn_pincode=0x7f07002a; - public static final int btn_scan=0x7f070030; - public static final int btn_scanDevices=0x7f07000f; - public static final int button1=0x7f070037; - public static final int button2=0x7f070038; - public static final int button3=0x7f070039; - public static final int buttons_view=0x7f070036; - public static final int checkBox_password=0x7f07001b; - public static final int content=0x7f070035; - public static final int customtitlebar=0x7f070029; - public static final int decode=0x7f070001; - public static final int decode_failed=0x7f070002; - public static final int decode_succeeded=0x7f070003; - public static final int encode_failed=0x7f070004; - public static final int encode_succeeded=0x7f070005; - public static final int encrypt_type=0x7f070019; - public static final int icon=0x7f070028; - public static final int icon_sub=0x7f070031; - public static final int id_ap_password=0x7f07001a; - public static final int id_device_name=0x7f070034; - public static final int img=0x7f07002c; - public static final int info=0x7f07002f; - public static final int info_aplist=0x7f07003f; - public static final int launch_product_query=0x7f070006; - public static final int layer1_linear1=0x7f07000d; - public static final int layer1_linear2=0x7f070011; - public static final int layer1_linear3=0x7f070014; - public static final int layer2_linear1=0x7f070012; - public static final int layer2_linear2=0x7f070015; - public static final int linearLayout1=0x7f07002d; - public static final int linearLayout2=0x7f07002b; - public static final int linearLayout_confirm=0x7f070033; - public static final int listView1=0x7f070013; - public static final int mainlayout=0x7f07000c; - public static final int network_name_edit=0x7f070018; - public static final int preview_view=0x7f07003a; - public static final int quit=0x7f070007; - public static final int radioButton1=0x7f070040; - public static final int restart_preview=0x7f070008; - public static final int return_scan_result=0x7f070009; - public static final int search_book_contents_failed=0x7f07000a; - public static final int search_book_contents_succeeded=0x7f07000b; - public static final int signalImg=0x7f07003d; - public static final int textDeviceTitle=0x7f07000e; - public static final int title=0x7f07002e; - public static final int title_aplist=0x7f07003e; - public static final int viewfinder_view=0x7f07003b; - } - public static final class layout { - public static final int activity_main=0x7f030000; - public static final int add_network_content=0x7f030001; - public static final int base_content=0x7f030002; - public static final int buttons_view_divider=0x7f030003; - public static final int cfg_num_pin_setting=0x7f030004; - public static final int confirm_list=0x7f030005; - public static final int confirm_pincode_entry=0x7f030006; - public static final int customtitlebar=0x7f030007; - public static final int device_list=0x7f030008; - public static final int device_list_confirm=0x7f030009; - public static final int device_rename=0x7f03000a; - public static final int floating=0x7f03000b; - public static final int qrcode_scanner=0x7f03000c; - public static final int title_view=0x7f03000d; - public static final int wifi_password_entry=0x7f03000e; - public static final int wifiap_list=0x7f03000f; - } - public static final class menu { - public static final int main=0x7f0a0000; - } - public static final class raw { - public static final int beep=0x7f040000; - } - public static final class string { - public static final int action_settings=0x7f080001; - public static final int adhoc_not_supported_yet=0x7f08002c; - public static final int ap_connected=0x7f080003; - public static final int ap_unconnected=0x7f080004; - public static final int app_name=0x7f080000; - public static final int buttonOp=0x7f080006; - public static final int button_change_password=0x7f080029; - public static final int cancel=0x7f080012; - /** Button label to connect to a wifi network - */ - public static final int connect=0x7f080011; - public static final int del_prof=0x7f080010; - /** For Simple Control Layout Interface - */ - public static final int dev_discovery=0x7f08000e; - public static final int dummy_content_description=0x7f08002d; - /** Button caption to forget a wifi network - */ - public static final int forget_network=0x7f080016; - public static final int hello_world=0x7f080002; - /** Wi-Fi IP address label - */ - public static final int ip_address=0x7f080014; - public static final int pin_text=0x7f080008; - public static final int please_type_passphrase=0x7f080026; - public static final int qrcode_cancel=0x7f08000b; - public static final int qrcode_desc=0x7f080009; - public static final int qrcode_title=0x7f08000a; - public static final int rename_dev=0x7f08000f; - /** Label for the security of a wifi network - */ - public static final int security=0x7f08001f; - /** Label for the signal strength - */ - public static final int signal=0x7f080015; - public static final int start_config=0x7f08000c; - /** Wi-Fi settings screen, summary text for network when connected - */ - public static final int status_connected=0x7f080018; - public static final int status_connecting=0x7f080019; - public static final int stop_config=0x7f08000d; - public static final int toastFailed=0x7f080005; - public static final int wifi_change_password=0x7f080028; - /** !!!!!!!! vpn_connect_toTitle of VPN connect dialog - */ - public static final int wifi_connect_to=0x7f080013; - /** Label for link speed (wifi) - */ - public static final int wifi_link_speed=0x7f08001a; - /** An edit field's grayed out value when it has not been modified - */ - public static final int wifi_password_unchanged=0x7f08002a; - /** Button caption to save a configuration wifi - */ - public static final int wifi_save_config=0x7f08002b; - /** For Simple Config Layout Interface - */ - public static final int wifi_scan=0x7f080007; - /** Value for the wifi security - */ - public static final int wifi_security_ieee8021x=0x7f080025; - /** Value for the wifi security. This means no encryption. - */ - public static final int wifi_security_open=0x7f080020; - /** Value for the wifi security - */ - public static final int wifi_security_wep=0x7f080021; - /** Value for the wifi security - */ - public static final int wifi_security_wpa=0x7f080022; - /** Value for the wifi security - */ - public static final int wifi_security_wpa2=0x7f080023; - /** Value for the wifi security - */ - public static final int wifi_security_wpa_eap=0x7f080024; - public static final int wifi_show_password=0x7f080027; - /** Verbose wifi signal strength. This is the worst out of 4 levels. - */ - public static final int wifi_signal_0=0x7f08001e; - /** Verbose wifi signal strength. This is the 3rd best out of 4 levels. - */ - public static final int wifi_signal_1=0x7f08001d; - /** Verbose wifi signal strength. This is the 2nd best out of 4 levels. - */ - public static final int wifi_signal_2=0x7f08001c; - /** Verbose wifi signal strength. This is the best out of 4 levels. - */ - public static final int wifi_signal_3=0x7f08001b; - /** Label for status of connection - */ - public static final int wifi_status=0x7f080017; - } - public static final class style { - /** - Base application theme, dependent on API level. This theme is replaced - by AppBaseTheme from res/values-vXX/styles.xml on newer devices. - - - Theme customizations available in newer API levels can go in - res/values-vXX/styles.xml, while customizations related to - backward-compatibility can go here. - - - Base application theme for API 11+. This theme completely replaces - AppBaseTheme from res/values/styles.xml on API 11+ devices. - - API 11 theme customizations can go here. - - Base application theme for API 14+. This theme completely replaces - AppBaseTheme from BOTH res/values/styles.xml and - res/values-v11/styles.xml on API 14+ devices. - - API 14 theme customizations can go here. - */ - public static final int AppBaseTheme=0x7f090001; - /** Application theme. - All customizations that are NOT specific to a particular API-level can go here. - */ - public static final int AppTheme=0x7f090002; - public static final int ButtonText=0x7f090000; - public static final int PlatformDialog=0x7f090003; - public static final int textAppearanceBaseContent=0x7f090004; - } -} diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/ic_launcher-web.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/ic_launcher-web.png deleted file mode 100644 index a18cbb4..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/ic_launcher-web.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/android-support-v4.jar b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/android-support-v4.jar deleted file mode 100644 index 9056828..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/android-support-v4.jar and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/armeabi-v7a/libsimpleconfiglib.so b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/armeabi-v7a/libsimpleconfiglib.so deleted file mode 100644 index e7390a9..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/armeabi-v7a/libsimpleconfiglib.so and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/armeabi/libsimpleconfiglib.so b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/armeabi/libsimpleconfiglib.so deleted file mode 100644 index 228fc72..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/armeabi/libsimpleconfiglib.so and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/gson-2.2.1.jar b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/gson-2.2.1.jar deleted file mode 100644 index 93ac6d7..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/gson-2.2.1.jar and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/mips/libsimpleconfiglib.so b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/mips/libsimpleconfiglib.so deleted file mode 100644 index a307825..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/mips/libsimpleconfiglib.so and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/simpleconfigwizard_r3_lib.jar b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/simpleconfigwizard_r3_lib.jar deleted file mode 100644 index e80121f..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/simpleconfigwizard_r3_lib.jar and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/x86/libsimpleconfiglib.so b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/x86/libsimpleconfiglib.so deleted file mode 100644 index 60d022c..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/x86/libsimpleconfiglib.so and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/zxing.jar b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/zxing.jar deleted file mode 100644 index 29fa881..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/libs/zxing.jar and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/lint.xml b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/lint.xml deleted file mode 100644 index b299ad0..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/lint.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/proguard-project.txt b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/proguard-project.txt deleted file mode 100644 index f2fe155..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/project.properties b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/project.properties deleted file mode 100644 index 4ab1256..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/project.properties +++ /dev/null @@ -1,14 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-19 diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-hdpi/ic_launcher.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 288b665..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-mdpi/ic_launcher.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 6ae570b..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-xhdpi/ic_launcher.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index d4fb7cd..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-xxhdpi/ic_launcher.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index 85a6081..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/add_icon.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/add_icon.png deleted file mode 100644 index 2c86e94..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/add_icon.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/background_scrollview.xml b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/background_scrollview.xml deleted file mode 100644 index 28e1756..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/background_scrollview.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/btn_new_device.xml b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/btn_new_device.xml deleted file mode 100644 index 58d5f51..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/btn_new_device.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/ic_dialog_icon.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/ic_dialog_icon.png deleted file mode 100644 index 5b5add5..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/ic_dialog_icon.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/icon.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/icon.png deleted file mode 100644 index 56279ab..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/icon.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/info.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/info.png deleted file mode 100644 index 6a7a1e9..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/info.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/navbar.9.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/navbar.9.png deleted file mode 100644 index cdf704e..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/navbar.9.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/pin_code_disable.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/pin_code_disable.png deleted file mode 100644 index 481aabd..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/pin_code_disable.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/pin_code_enable.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/pin_code_enable.png deleted file mode 100644 index 904aadd..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/pin_code_enable.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/qrcode_img.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/qrcode_img.png deleted file mode 100644 index 9df4f0d..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/qrcode_img.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/refresh.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/refresh.png deleted file mode 100644 index e13315f..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/refresh.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/refresh1.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/refresh1.png deleted file mode 100644 index 468d79e..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/refresh1.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/settings.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/settings.png deleted file mode 100644 index 007ce41..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/settings.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/settings_icon.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/settings_icon.png deleted file mode 100644 index 8798c59..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/settings_icon.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal1.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal1.png deleted file mode 100644 index bbf8cac..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal1.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal2.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal2.png deleted file mode 100644 index 0e738e4..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal2.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal3.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal3.png deleted file mode 100644 index 7d00864..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal3.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal4.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal4.png deleted file mode 100644 index acc3eb9..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal4.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal5.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal5.png deleted file mode 100644 index 55e23e3..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/signal5.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/speaker.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/speaker.png deleted file mode 100644 index e7d553a..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/drawable/speaker.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/layout/activity_main.xml b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/layout/activity_main.xml deleted file mode 100644 index 612f33b..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/simple_config_wizard/Android/SimpleConfigWizard_R3/res/layout/activity_main.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Cell.h b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Cell.h deleted file mode 100644 index bc91e67..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Cell.h +++ /dev/null @@ -1,16 +0,0 @@ -/* -Copyright (C) 2015 Apple Inc. All Rights Reserved. -See LICENSE.txt for this sample’s licensing information - -Abstract: -Custom collection view cell for image and its label. -*/ - -@import UIKit; - -@interface Cell : UICollectionViewCell - -@property (strong, nonatomic) IBOutlet UIImageView *image; -@property (strong, nonatomic) IBOutlet UILabel *label; - -@end diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Cell.m b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Cell.m deleted file mode 100644 index 4b62c12..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Cell.m +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright (C) 2015 Apple Inc. All Rights Reserved. -See LICENSE.txt for this sample’s licensing information - -Abstract: -Custom collection view cell for image and its label. -*/ - -#import "Cell.h" -#import "CustomCellBackground.h" - -@implementation Cell - - -- (instancetype)initWithCoder:(NSCoder *)aDecoder -{ - self = [super initWithCoder:aDecoder]; - if (self) - { - // change to our custom selected background view - CustomCellBackground *backgroundView = [[CustomCellBackground alloc] initWithFrame:CGRectZero]; - self.selectedBackgroundView = backgroundView; - } - return self; -} - -@end diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ChatViewController.h b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ChatViewController.h deleted file mode 100644 index f6984d2..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ChatViewController.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (C) 2015 Apple Inc. All Rights Reserved. -See LICENSE.txt for this sample’s licensing information - -Abstract: -The secondary detailed view controller for this app. -*/ - -#import - -@interface ChatViewController : UIViewController -{ - NSNetServiceBrowser *_netServiceBrowser; - NSMutableArray *_servicesArray; - - NSMutableArray *messages; - NSInputStream *inputStream; - NSOutputStream *outputStream; -} - -@property (nonatomic, retain) NSNetService *selectedService; -@property (nonatomic, retain) NSMutableArray *dataServicesArray; - - -@property (nonatomic, retain) NSInputStream *inputStream; -@property (nonatomic, retain) NSOutputStream *outputStream; -@property (nonatomic, retain) NSMutableArray *messages; - -- (IBAction) sendMessage; -@property (nonatomic, retain) IBOutlet UITextView *chatMessageField; -@property (nonatomic, retain) IBOutlet UITextField *inputMessageField; -@end diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ChatViewController.m b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ChatViewController.m deleted file mode 100644 index 3852cbe..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ChatViewController.m +++ /dev/null @@ -1,348 +0,0 @@ -/* -Copyright (C) 2015 Apple Inc. All Rights Reserved. -See LICENSE.txt for this sample’s licensing information - -Abstract: -The secondary detailed view controller for this app. -*/ - - -#import "ChatViewController.h" -#include -#include - -@interface ChatViewController () - -@end - -@implementation ChatViewController - -@synthesize inputStream, outputStream; -@synthesize inputMessageField,chatMessageField; -@synthesize selectedService = _selectedService; -@synthesize messages; - -NSString *UART_DATA_TYPE=@"_uart_data._tcp.local."; -NSDateFormatter *formatter; -NSString *timeString; -NSMutableAttributedString *attrMessage; - -- (void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; - - - UIGraphicsBeginImageContext(self.view.frame.size); - [[UIImage imageNamed:@"background.png"] drawInRect:self.view.bounds]; - UIImage *bgImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - - self.chatMessageField.contentMode = UIViewContentModeScaleToFill; - self.chatMessageField.backgroundColor=[UIColor colorWithPatternImage:bgImage]; - - - - self.dataServicesArray = [[NSMutableArray alloc] init]; - [self startDiscover:UART_DATA_TYPE]; - - - self.inputMessageField.delegate = self; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:@"UIKeyboardWillShowNotification" - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardDidHide:) - name:@"UIKeyboardWillHideNotification" - object:nil]; - formatter = [[NSDateFormatter alloc] init]; - [formatter setDateFormat:@"HH:mm"]; - - - NSAttributedString *objectString = - [[NSAttributedString alloc] initWithString:@"" - attributes:@{ - NSForegroundColorAttributeName : [UIColor redColor], - NSFontAttributeName : [UIFont boldSystemFontOfSize:20] - }]; - - attrMessage = [[NSMutableAttributedString alloc] initWithAttributedString:objectString]; - -} - -- (BOOL)textFieldShouldReturn:(UITextField *)textField { - [textField resignFirstResponder]; - return NO; -} - -- (void) keyboardWillShow:(NSNotification *)note { - NSDictionary *userInfo = [note userInfo]; - CGSize kbSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - - - - // move the view up by 30 pts - CGRect frame = self.view.frame; - frame.origin.y = -kbSize.height; - - [UIView animateWithDuration:0.01 animations:^{ - self.view.frame = frame; - }]; -} - -- (void) keyboardDidHide:(NSNotification *)note { - - // move the view back to the origin - CGRect frame = self.view.frame; - frame.origin.y = 0; - self.view.frame = frame; - -} - --(void) startDiscover:(NSString *)browseType -{ - self->_netServiceBrowser = [[NSNetServiceBrowser alloc] init]; - self->_netServiceBrowser.delegate = self; - - NSArray *domainNameParts = [browseType componentsSeparatedByString:@"."]; - - browseType = [NSString stringWithFormat:@"%@.%@.", [domainNameParts objectAtIndex:0], [domainNameParts objectAtIndex:1]]; - - [self->_netServiceBrowser searchForServicesOfType:browseType inDomain:@""]; -} - - --(void)netServiceBrowser:(NSNetServiceBrowser *)aNetServiceBrowser didFindService:(NSNetService *)aNetService moreComing:(BOOL)moreComing { - - [self.dataServicesArray addObject:aNetService]; - - - - if (moreComing == NO) { - NSSortDescriptor *sd = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; - [self.dataServicesArray sortUsingDescriptors:[NSArray arrayWithObject:sd]]; - //[sd release]; - - self->_netServiceBrowser.delegate = nil; - [self->_netServiceBrowser stop]; - self->_netServiceBrowser = nil; - self.title = self.selectedService.name; - } - - if([self.selectedService.name isEqualToString:aNetService.name]) - { - aNetService.delegate = self; - [aNetService resolveWithTimeout:10.0]; - } -} - - --(void)netServiceDidResolveAddress:(NSNetService *)service { - - NSData *address = [service.addresses objectAtIndex:0]; - char addressString[INET6_ADDRSTRLEN]; - int inetType; - - struct sockaddr_in6 addr6; - memcpy(&addr6, address.bytes, address.length); - - if (address.length == 16) { // IPv4 - inetType = AF_INET; - struct sockaddr_in addr4; - memcpy(&addr4, address.bytes, address.length); - inet_ntop(AF_INET, &addr4.sin_addr, addressString, 512); - [self initNetworkCommunication:[NSString stringWithCString:addressString encoding:NSASCIIStringEncoding] Port:(int)service.port]; - - } - - - -} - -- (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didRemoveService:(NSNetService *)netService moreComing:(BOOL)moreComing { - for (int i = 0; i < self.dataServicesArray.count; i++) { - if ([((NSNetService *)[self.dataServicesArray objectAtIndex:i]).name isEqualToString:netService.name]) { - [self.dataServicesArray removeObjectAtIndex:i]; - break; - } - } - if (moreComing == NO) { - - NSSortDescriptor *sd = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; - [self.dataServicesArray sortUsingDescriptors:[NSArray arrayWithObject:sd]]; - } -} - -#pragma mark - -#pragma mark NSNetServiceDelegate methods --(void)netService:(NSNetService *)sender didNotResolve:(NSDictionary *)errorDict { - NSNumber *errorCode = [errorDict valueForKey:NSNetServicesErrorCode]; - - NSString *errorMessage; - switch ([errorCode intValue]) { - case NSNetServicesActivityInProgress: - errorMessage = @"Service Resolution Currently in Progress. Please Wait."; - break; - case NSNetServicesTimeoutError: - errorMessage = @"Service Resolution Timeout"; - [sender stop]; - //UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Bonjour Browser" message:errorMessage delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; - // [alert show]; - break; - } - - - //[alert release]; -} - -#pragma mark - -#pragma mark NSNetServiceBrowserDelegate methods --(void)netServiceBrowser:(NSNetServiceBrowser *)browser didNotSearch:(NSDictionary *)errorDict { - self->_netServiceBrowser.delegate = nil; - [self->_netServiceBrowser stop]; - self->_netServiceBrowser = nil; -} - --(void)netServiceBrowserDidStopSearch:(NSNetServiceBrowser *)browser { - self->_netServiceBrowser.delegate = nil; - self->_netServiceBrowser = nil; -} - - - - -- (void) initNetworkCommunication:(NSString *)mIP Port:(int)mPort { - - CFReadStreamRef readStream; - CFWriteStreamRef writeStream; - CFStreamCreatePairWithSocketToHost(NULL, (__bridge CFStringRef)mIP, mPort, &readStream, &writeStream); - - inputStream = (__bridge NSInputStream *)readStream; - outputStream = (__bridge NSOutputStream *)writeStream; - [inputStream setDelegate:self]; - [outputStream setDelegate:self]; - [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - [inputStream open]; - [outputStream open]; - -} - - -- (IBAction) sendMessage { - NSAttributedString *sendingString; - - timeString = [formatter stringFromDate:[NSDate date]]; - - NSString *response = [NSString stringWithFormat:@"%@\n", inputMessageField.text]; - NSData *data = [[NSData alloc] initWithData:[response dataUsingEncoding:NSASCIIStringEncoding]]; - [outputStream write:[data bytes] maxLength:[data length]]; - response = [NSString stringWithFormat:@"%@ [Me] %@\n",timeString, inputMessageField.text]; - sendingString = - [[NSAttributedString alloc] initWithString:response - attributes:@{ - NSForegroundColorAttributeName : [UIColor blueColor], - NSFontAttributeName : [UIFont boldSystemFontOfSize:20] - }]; - inputMessageField.text = @""; - [attrMessage appendAttributedString:sendingString]; - [chatMessageField setAttributedText:attrMessage]; - [inputMessageField resignFirstResponder]; -} - - -- (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent { - - - - switch (streamEvent) { - - case NSStreamEventOpenCompleted: - NSLog(@"Stream opened"); - break; - case NSStreamEventHasBytesAvailable: - - if (theStream == inputStream) { - - uint8_t buffer[1024]; - int len; - - while ([inputStream hasBytesAvailable]) { - len = [[NSNumber numberWithInteger:[inputStream read:buffer maxLength: sizeof(buffer)]] intValue] ; - if (len > 0) { - - NSString *output = [[NSString alloc] initWithBytes:buffer length:len encoding:NSASCIIStringEncoding]; - - if (nil != output) { - - - [self messageReceived:output]; - - } - } - } - } - break; - - - case NSStreamEventErrorOccurred: - - NSLog(@"Can not connect to the host!"); - break; - - case NSStreamEventEndEncountered: - - [theStream close]; - [theStream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - //[theStream release]; - theStream = nil; - - break; - default: - NSLog(@"Unknown event"); - } - -} - -- (void) messageReceived:(NSString *)message { - - NSAttributedString *receivedString; - - [self.chatMessageField setTintColor:[UIColor greenColor]]; - timeString = [formatter stringFromDate:[NSDate date]]; - receivedString = - [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ [Ameba] %@\n", timeString ,message] - attributes:@{ - NSForegroundColorAttributeName : [UIColor purpleColor], - NSFontAttributeName : [UIFont boldSystemFontOfSize:20] - }]; - - [attrMessage appendAttributedString:receivedString]; - [chatMessageField setAttributedText:attrMessage]; -} - - - - -- (void)viewDidUnload { - [super viewDidUnload]; - - self->_netServiceBrowser.delegate = nil; - [self->_netServiceBrowser stop]; - self->_netServiceBrowser = nil; -} - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [inputStream close]; - [outputStream close]; - self->_netServiceBrowser = nil; - self.dataServicesArray = nil; - self.selectedService = nil; -} - - -@end diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/CustomCellBackground.h b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/CustomCellBackground.h deleted file mode 100644 index 77b14e1..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/CustomCellBackground.h +++ /dev/null @@ -1,13 +0,0 @@ -/* -Copyright (C) 2015 Apple Inc. All Rights Reserved. -See LICENSE.txt for this sample’s licensing information - -Abstract: -Custom UIView to draw a rounded blue box to represent a selected cell. -*/ - -@import UIKit; - -@interface CustomCellBackground : UIView - -@end diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/CustomCellBackground.m b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/CustomCellBackground.m deleted file mode 100644 index 3434632..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/CustomCellBackground.m +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (C) 2015 Apple Inc. All Rights Reserved. -See LICENSE.txt for this sample’s licensing information - -Abstract: -Custom UIView to draw a rounded blue box to represent a selected cell. -*/ - -#import "CustomCellBackground.h" - -@implementation CustomCellBackground - -- (void)drawRect:(CGRect)rect -{ - // draw a rounded rect bezier path filled with blue - CGContextRef aRef = UIGraphicsGetCurrentContext(); - CGContextSaveGState(aRef); - UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:5.0f]; - bezierPath.lineWidth = 5.0f; - [[UIColor blackColor] setStroke]; - - UIColor *fillColor = [UIColor colorWithRed:0.529 green:0.808 blue:0.922 alpha:1]; // color equivalent is #87ceeb - [fillColor setFill]; - - [bezierPath stroke]; - [bezierPath fill]; - CGContextRestoreGState(aRef); -} - -@end diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/AppIcon.appiconset/Contents.json b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index eeea76c..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/action_icon.imageset/Contents.json b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/action_icon.imageset/Contents.json deleted file mode 100644 index 9c963ab..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/action_icon.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x", - "filename" : "action_icon@2x.png" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/action_icon.imageset/action_icon@2x.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/action_icon.imageset/action_icon@2x.png deleted file mode 100644 index 9b2c88b..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/action_icon.imageset/action_icon@2x.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ameba_group.imageset/Contents.json b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ameba_group.imageset/Contents.json deleted file mode 100644 index 1e6c0a0..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ameba_group.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "ameba_group.png" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ameba_group.imageset/ameba_group.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ameba_group.imageset/ameba_group.png deleted file mode 100644 index 89c6f1b..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ameba_group.imageset/ameba_group.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/background.imageset/Contents.json b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/background.imageset/Contents.json deleted file mode 100644 index 790c09f..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/background.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "background.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/background.imageset/background.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/background.imageset/background.png deleted file mode 100644 index d211705..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/background.imageset/background.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/chat.imageset/Contents.json b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/chat.imageset/Contents.json deleted file mode 100644 index 624e2f7..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/chat.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "chat.png" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/chat.imageset/chat.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/chat.imageset/chat.png deleted file mode 100644 index be98f09..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/chat.imageset/chat.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/device.imageset/Contents.json b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/device.imageset/Contents.json deleted file mode 100644 index fee5929..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/device.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "device.png" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/device.imageset/device.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/device.imageset/device.png deleted file mode 100644 index 634ba9e..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/device.imageset/device.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/settings.imageset/Contents.json b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/settings.imageset/Contents.json deleted file mode 100644 index e5ea6bf..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/settings.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "settings.png" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/settings.imageset/settings.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/settings.imageset/settings.png deleted file mode 100644 index 4dcd031..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/settings.imageset/settings.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ungroup.imageset/Contents.json b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ungroup.imageset/Contents.json deleted file mode 100644 index e26f359..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ungroup.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "ungroup.png" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ungroup.imageset/ungroup.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ungroup.imageset/ungroup.png deleted file mode 100644 index 4c16477..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Images.xcassets/ungroup.imageset/ungroup.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Info.plist b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Info.plist deleted file mode 100644 index 0ca4d80..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/KxMenu.h b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/KxMenu.h deleted file mode 100644 index 0de0c5d..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/KxMenu.h +++ /dev/null @@ -1,67 +0,0 @@ -// -// KxMenu.h -// kxmenu project -// https://github.com/kolyvan/kxmenu/ -// -// Created by Kolyvan on 17.05.13. -// - -/* - Copyright (c) 2013 Konstantin Bukreev. All rights reserved. - - 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. - - 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 HOLDER 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. -*/ - - -#import - -@interface KxMenuItem : NSObject - -@property (readwrite, nonatomic, strong) UIImage *image; -@property (readwrite, nonatomic, strong) NSString *title; -@property (readwrite, nonatomic, weak) id target; -@property (readwrite, nonatomic) SEL action; -@property (readwrite, nonatomic, strong) UIColor *foreColor; -@property (readwrite, nonatomic) NSTextAlignment alignment; - -+ (instancetype) menuItem:(NSString *) title - image:(UIImage *) image - target:(id)target - action:(SEL) action; - -@end - -@interface KxMenu : NSObject - -+ (void) showMenuInView:(UIView *)view - fromRect:(CGRect)rect - menuItems:(NSArray *)menuItems; - -+ (void) dismissMenu; - -+ (UIColor *) tintColor; -+ (void) setTintColor: (UIColor *) tintColor; - -+ (UIFont *) titleFont; -+ (void) setTitleFont: (UIFont *) titleFont; - -@end diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/KxMenu.m b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/KxMenu.m deleted file mode 100644 index 453fe3a..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/KxMenu.m +++ /dev/null @@ -1,889 +0,0 @@ -// -// KxMenu.m -// kxmenu project -// https://github.com/kolyvan/kxmenu/ -// -// Created by Kolyvan on 17.05.13. -// - -/* - Copyright (c) 2013 Konstantin Bukreev. All rights reserved. - - 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. - - 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 HOLDER 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. -*/ - -/* - Some ideas was taken from QBPopupMenu project by Katsuma Tanaka. - https://github.com/questbeat/QBPopupMenu -*/ - -#import "KxMenu.h" -#import - -const CGFloat kArrowSize = 12.f; - -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - -@interface KxMenuView : UIView -- (void)dismissMenu:(BOOL) animated; -@end - -@interface KxMenuOverlay : UIView -@end - -@implementation KxMenuOverlay - - - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - self.backgroundColor = [UIColor clearColor]; - self.opaque = NO; - - UITapGestureRecognizer *gestureRecognizer; - gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self - action:@selector(singleTap:)]; - [self addGestureRecognizer:gestureRecognizer]; - } - return self; -} - -// thank horaceho https://github.com/horaceho -// for his solution described in https://github.com/kolyvan/kxmenu/issues/9 - -- (void)singleTap:(UITapGestureRecognizer *)recognizer -{ - for (UIView *v in self.subviews) { - if ([v isKindOfClass:[KxMenuView class]] && [v respondsToSelector:@selector(dismissMenu:)]) { - [v performSelector:@selector(dismissMenu:) withObject:@(YES)]; - } - } -} - -@end - -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - -@implementation KxMenuItem - -+ (instancetype) menuItem:(NSString *) title - image:(UIImage *) image - target:(id)target - action:(SEL) action -{ - return [[KxMenuItem alloc] init:title - image:image - target:target - action:action]; -} - -- (id) init:(NSString *) title - image:(UIImage *) image - target:(id)target - action:(SEL) action -{ - NSParameterAssert(title.length || image); - - self = [super init]; - if (self) { - - _title = title; - _image = image; - _target = target; - _action = action; - } - return self; -} - -- (BOOL) enabled -{ - return _target != nil && _action != NULL; -} - -- (void) performAction -{ - __strong id target = self.target; - - if (target && [target respondsToSelector:_action]) { - - [target performSelectorOnMainThread:_action withObject:self waitUntilDone:YES]; - } -} - -- (NSString *) description -{ - return [NSString stringWithFormat:@"<%@ #%p %@>", [self class], self, _title]; -} - -@end - -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - -typedef enum { - - KxMenuViewArrowDirectionNone, - KxMenuViewArrowDirectionUp, - KxMenuViewArrowDirectionDown, - KxMenuViewArrowDirectionLeft, - KxMenuViewArrowDirectionRight, - -} KxMenuViewArrowDirection; - -@implementation KxMenuView { - - KxMenuViewArrowDirection _arrowDirection; - CGFloat _arrowPosition; - UIView *_contentView; - NSArray *_menuItems; -} - -- (id)init -{ - self = [super initWithFrame:CGRectZero]; - if(self) { - - self.backgroundColor = [UIColor clearColor]; - self.opaque = YES; - self.alpha = 0; - - self.layer.shadowOpacity = 0.5; - self.layer.shadowOffset = CGSizeMake(2, 2); - self.layer.shadowRadius = 2; - } - - return self; -} - - - -- (void) setupFrameInView:(UIView *)view - fromRect:(CGRect)fromRect -{ - const CGSize contentSize = _contentView.frame.size; - - const CGFloat outerWidth = view.bounds.size.width; - const CGFloat outerHeight = view.bounds.size.height; - - const CGFloat rectX0 = fromRect.origin.x; - const CGFloat rectX1 = fromRect.origin.x + fromRect.size.width; - const CGFloat rectXM = fromRect.origin.x + fromRect.size.width * 0.5f; - const CGFloat rectY0 = fromRect.origin.y; - const CGFloat rectY1 = fromRect.origin.y + fromRect.size.height; - const CGFloat rectYM = fromRect.origin.y + fromRect.size.height * 0.5f;; - - const CGFloat widthPlusArrow = contentSize.width + kArrowSize; - const CGFloat heightPlusArrow = contentSize.height + kArrowSize; - const CGFloat widthHalf = contentSize.width * 0.5f; - const CGFloat heightHalf = contentSize.height * 0.5f; - - const CGFloat kMargin = 5.f; - - if (heightPlusArrow < (outerHeight - rectY1)) { - - _arrowDirection = KxMenuViewArrowDirectionUp; - CGPoint point = (CGPoint){ - rectXM - widthHalf, - rectY1 - }; - - if (point.x < kMargin) - point.x = kMargin; - - if ((point.x + contentSize.width + kMargin) > outerWidth) - point.x = outerWidth - contentSize.width - kMargin; - - _arrowPosition = rectXM - point.x; - //_arrowPosition = MAX(16, MIN(_arrowPosition, contentSize.width - 16)); - _contentView.frame = (CGRect){0, kArrowSize, contentSize}; - - self.frame = (CGRect) { - - point, - contentSize.width, - contentSize.height + kArrowSize - }; - - } else if (heightPlusArrow < rectY0) { - - _arrowDirection = KxMenuViewArrowDirectionDown; - CGPoint point = (CGPoint){ - rectXM - widthHalf, - rectY0 - heightPlusArrow - }; - - if (point.x < kMargin) - point.x = kMargin; - - if ((point.x + contentSize.width + kMargin) > outerWidth) - point.x = outerWidth - contentSize.width - kMargin; - - _arrowPosition = rectXM - point.x; - _contentView.frame = (CGRect){CGPointZero, contentSize}; - - self.frame = (CGRect) { - - point, - contentSize.width, - contentSize.height + kArrowSize - }; - - } else if (widthPlusArrow < (outerWidth - rectX1)) { - - _arrowDirection = KxMenuViewArrowDirectionLeft; - CGPoint point = (CGPoint){ - rectX1, - rectYM - heightHalf - }; - - if (point.y < kMargin) - point.y = kMargin; - - if ((point.y + contentSize.height + kMargin) > outerHeight) - point.y = outerHeight - contentSize.height - kMargin; - - _arrowPosition = rectYM - point.y; - _contentView.frame = (CGRect){kArrowSize, 0, contentSize}; - - self.frame = (CGRect) { - - point, - contentSize.width + kArrowSize, - contentSize.height - }; - - } else if (widthPlusArrow < rectX0) { - - _arrowDirection = KxMenuViewArrowDirectionRight; - CGPoint point = (CGPoint){ - rectX0 - widthPlusArrow, - rectYM - heightHalf - }; - - if (point.y < kMargin) - point.y = kMargin; - - if ((point.y + contentSize.height + 5) > outerHeight) - point.y = outerHeight - contentSize.height - kMargin; - - _arrowPosition = rectYM - point.y; - _contentView.frame = (CGRect){CGPointZero, contentSize}; - - self.frame = (CGRect) { - - point, - contentSize.width + kArrowSize, - contentSize.height - }; - - } else { - - _arrowDirection = KxMenuViewArrowDirectionNone; - - self.frame = (CGRect) { - - (outerWidth - contentSize.width) * 0.5f, - (outerHeight - contentSize.height) * 0.5f, - contentSize, - }; - } -} - -- (void)showMenuInView:(UIView *)view - fromRect:(CGRect)rect - menuItems:(NSArray *)menuItems -{ - _menuItems = menuItems; - - _contentView = [self mkContentView]; - [self addSubview:_contentView]; - - [self setupFrameInView:view fromRect:rect]; - - KxMenuOverlay *overlay = [[KxMenuOverlay alloc] initWithFrame:view.bounds]; - [overlay addSubview:self]; - [view addSubview:overlay]; - - _contentView.hidden = YES; - const CGRect toFrame = self.frame; - self.frame = (CGRect){self.arrowPoint, 1, 1}; - - [UIView animateWithDuration:0.2 - animations:^(void) { - - self.alpha = 1.0f; - self.frame = toFrame; - - } completion:^(BOOL completed) { - _contentView.hidden = NO; - }]; - -} - -- (void)dismissMenu:(BOOL) animated -{ - if (self.superview) { - - if (animated) { - - _contentView.hidden = YES; - const CGRect toFrame = (CGRect){self.arrowPoint, 1, 1}; - - [UIView animateWithDuration:0.2 - animations:^(void) { - - self.alpha = 0; - self.frame = toFrame; - - } completion:^(BOOL finished) { - - if ([self.superview isKindOfClass:[KxMenuOverlay class]]) - [self.superview removeFromSuperview]; - [self removeFromSuperview]; - }]; - - } else { - - if ([self.superview isKindOfClass:[KxMenuOverlay class]]) - [self.superview removeFromSuperview]; - [self removeFromSuperview]; - } - } -} - -- (void)performAction:(id)sender -{ - [self dismissMenu:YES]; - - UIButton *button = (UIButton *)sender; - KxMenuItem *menuItem = _menuItems[button.tag]; - [menuItem performAction]; -} - -- (UIView *) mkContentView -{ - for (UIView *v in self.subviews) { - [v removeFromSuperview]; - } - - if (!_menuItems.count) - return nil; - - const CGFloat kMinMenuItemHeight = 32.f; - const CGFloat kMinMenuItemWidth = 32.f; - const CGFloat kMarginX = 10.f; - const CGFloat kMarginY = 5.f; - - UIFont *titleFont = [KxMenu titleFont]; - if (!titleFont) titleFont = [UIFont boldSystemFontOfSize:16]; - - CGFloat maxImageWidth = 0; - CGFloat maxItemHeight = 0; - CGFloat maxItemWidth = 0; - - for (KxMenuItem *menuItem in _menuItems) { - - const CGSize imageSize = menuItem.image.size; - if (imageSize.width > maxImageWidth) - maxImageWidth = imageSize.width; - } - - if (maxImageWidth) { - maxImageWidth += kMarginX; - } - - for (KxMenuItem *menuItem in _menuItems) { - NSDictionary *attributes = @{NSFontAttributeName:titleFont}; - const CGSize titleSize = [menuItem.title sizeWithAttributes:attributes]; - const CGSize imageSize = menuItem.image.size; - - const CGFloat itemHeight = MAX(titleSize.height, imageSize.height) + kMarginY * 2; - const CGFloat itemWidth = ((!menuItem.enabled && !menuItem.image) ? titleSize.width : maxImageWidth + titleSize.width) + kMarginX * 4; - - if (itemHeight > maxItemHeight) - maxItemHeight = itemHeight; - - if (itemWidth > maxItemWidth) - maxItemWidth = itemWidth; - } - - maxItemWidth = MAX(maxItemWidth, kMinMenuItemWidth); - maxItemHeight = MAX(maxItemHeight, kMinMenuItemHeight); - - const CGFloat titleX = kMarginX * 2 + maxImageWidth; - const CGFloat titleWidth = maxItemWidth - titleX - kMarginX * 2; - - UIImage *selectedImage = [KxMenuView selectedImage:(CGSize){maxItemWidth, maxItemHeight + 2}]; - UIImage *gradientLine = [KxMenuView gradientLine: (CGSize){maxItemWidth - kMarginX * 4, 1}]; - - UIView *contentView = [[UIView alloc] initWithFrame:CGRectZero]; - contentView.autoresizingMask = UIViewAutoresizingNone; - contentView.backgroundColor = [UIColor clearColor]; - contentView.opaque = NO; - - CGFloat itemY = kMarginY * 2; - NSUInteger itemNum = 0; - - for (KxMenuItem *menuItem in _menuItems) { - - const CGRect itemFrame = (CGRect){0, itemY, maxItemWidth, maxItemHeight}; - - UIView *itemView = [[UIView alloc] initWithFrame:itemFrame]; - itemView.autoresizingMask = UIViewAutoresizingNone; - itemView.backgroundColor = [UIColor clearColor]; - itemView.opaque = NO; - - [contentView addSubview:itemView]; - - if (menuItem.enabled) { - - UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; - button.tag = itemNum; - button.frame = itemView.bounds; - button.enabled = menuItem.enabled; - button.backgroundColor = [UIColor clearColor]; - button.opaque = NO; - button.autoresizingMask = UIViewAutoresizingNone; - - [button addTarget:self - action:@selector(performAction:) - forControlEvents:UIControlEventTouchUpInside]; - - [button setBackgroundImage:selectedImage forState:UIControlStateHighlighted]; - - [itemView addSubview:button]; - } - - if (menuItem.title.length) { - - CGRect titleFrame; - - if (!menuItem.enabled && !menuItem.image) { - - titleFrame = (CGRect){ - kMarginX * 2, - kMarginY, - maxItemWidth - kMarginX * 4, - maxItemHeight - kMarginY * 2 - }; - - } else { - - titleFrame = (CGRect){ - titleX, - kMarginY, - titleWidth, - maxItemHeight - kMarginY * 2 - }; - } - - UILabel *titleLabel = [[UILabel alloc] initWithFrame:titleFrame]; - titleLabel.text = menuItem.title; - titleLabel.font = titleFont; - titleLabel.textAlignment = menuItem.alignment; - titleLabel.textColor = menuItem.foreColor ? menuItem.foreColor : [UIColor whiteColor]; - titleLabel.backgroundColor = [UIColor clearColor]; - titleLabel.autoresizingMask = UIViewAutoresizingNone; - //titleLabel.backgroundColor = [UIColor greenColor]; - [itemView addSubview:titleLabel]; - } - - if (menuItem.image) { - - const CGRect imageFrame = {kMarginX * 2, kMarginY, maxImageWidth, maxItemHeight - kMarginY * 2}; - UIImageView *imageView = [[UIImageView alloc] initWithFrame:imageFrame]; - imageView.image = menuItem.image; - imageView.clipsToBounds = YES; - imageView.contentMode = UIViewContentModeCenter; - imageView.autoresizingMask = UIViewAutoresizingNone; - [itemView addSubview:imageView]; - } - - if (itemNum < _menuItems.count - 1) { - - UIImageView *gradientView = [[UIImageView alloc] initWithImage:gradientLine]; - gradientView.frame = (CGRect){kMarginX * 2, maxItemHeight + 1, gradientLine.size}; - gradientView.contentMode = UIViewContentModeLeft; - [itemView addSubview:gradientView]; - - itemY += 2; - } - - itemY += maxItemHeight; - ++itemNum; - } - - contentView.frame = (CGRect){0, 0, maxItemWidth, itemY + kMarginY * 2}; - - return contentView; -} - -- (CGPoint) arrowPoint -{ - CGPoint point; - - if (_arrowDirection == KxMenuViewArrowDirectionUp) { - - point = (CGPoint){ CGRectGetMinX(self.frame) + _arrowPosition, CGRectGetMinY(self.frame) }; - - } else if (_arrowDirection == KxMenuViewArrowDirectionDown) { - - point = (CGPoint){ CGRectGetMinX(self.frame) + _arrowPosition, CGRectGetMaxY(self.frame) }; - - } else if (_arrowDirection == KxMenuViewArrowDirectionLeft) { - - point = (CGPoint){ CGRectGetMinX(self.frame), CGRectGetMinY(self.frame) + _arrowPosition }; - - } else if (_arrowDirection == KxMenuViewArrowDirectionRight) { - - point = (CGPoint){ CGRectGetMaxX(self.frame), CGRectGetMinY(self.frame) + _arrowPosition }; - - } else { - - point = self.center; - } - - return point; -} - -+ (UIImage *) selectedImage: (CGSize) size -{ - const CGFloat locations[] = {0,1}; - const CGFloat components[] = { - 0.216, 0.471, 0.871, 1, - 0.059, 0.353, 0.839, 1, - }; - - return [self gradientImageWithSize:size locations:locations components:components count:2]; -} - -+ (UIImage *) gradientLine: (CGSize) size -{ - const CGFloat locations[5] = {0,0.2,0.5,0.8,1}; - - const CGFloat R = 0.44f, G = 0.44f, B = 0.44f; - - const CGFloat components[20] = { - R,G,B,0.1, - R,G,B,0.4, - R,G,B,0.7, - R,G,B,0.4, - R,G,B,0.1 - }; - - return [self gradientImageWithSize:size locations:locations components:components count:5]; -} - -+ (UIImage *) gradientImageWithSize:(CGSize) size - locations:(const CGFloat []) locations - components:(const CGFloat []) components - count:(NSUInteger)count -{ - UIGraphicsBeginImageContextWithOptions(size, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGGradientRef colorGradient = CGGradientCreateWithColorComponents(colorSpace, components, locations, 2); - CGColorSpaceRelease(colorSpace); - CGContextDrawLinearGradient(context, colorGradient, (CGPoint){0, 0}, (CGPoint){size.width, 0}, 0); - CGGradientRelease(colorGradient); - - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -- (void) drawRect:(CGRect)rect -{ - [self drawBackground:self.bounds - inContext:UIGraphicsGetCurrentContext()]; -} - -- (void)drawBackground:(CGRect)frame - inContext:(CGContextRef) context -{ - CGFloat R0 = 0.267, G0 = 0.303, B0 = 0.335; - CGFloat R1 = 0.040, G1 = 0.040, B1 = 0.040; - - UIColor *tintColor = [KxMenu tintColor]; - if (tintColor) { - - CGFloat a; - [tintColor getRed:&R0 green:&G0 blue:&B0 alpha:&a]; - } - - CGFloat X0 = frame.origin.x; - CGFloat X1 = frame.origin.x + frame.size.width; - CGFloat Y0 = frame.origin.y; - CGFloat Y1 = frame.origin.y + frame.size.height; - - // render arrow - - UIBezierPath *arrowPath = [UIBezierPath bezierPath]; - - // fix the issue with gap of arrow's base if on the edge - const CGFloat kEmbedFix = 3.f; - - if (_arrowDirection == KxMenuViewArrowDirectionUp) { - - const CGFloat arrowXM = _arrowPosition; - const CGFloat arrowX0 = arrowXM - kArrowSize; - const CGFloat arrowX1 = arrowXM + kArrowSize; - const CGFloat arrowY0 = Y0; - const CGFloat arrowY1 = Y0 + kArrowSize + kEmbedFix; - - [arrowPath moveToPoint: (CGPoint){arrowXM, arrowY0}]; - [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY1}]; - [arrowPath addLineToPoint: (CGPoint){arrowX0, arrowY1}]; - [arrowPath addLineToPoint: (CGPoint){arrowXM, arrowY0}]; - - [[UIColor colorWithRed:R0 green:G0 blue:B0 alpha:1] set]; - - Y0 += kArrowSize; - - } else if (_arrowDirection == KxMenuViewArrowDirectionDown) { - - const CGFloat arrowXM = _arrowPosition; - const CGFloat arrowX0 = arrowXM - kArrowSize; - const CGFloat arrowX1 = arrowXM + kArrowSize; - const CGFloat arrowY0 = Y1 - kArrowSize - kEmbedFix; - const CGFloat arrowY1 = Y1; - - [arrowPath moveToPoint: (CGPoint){arrowXM, arrowY1}]; - [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY0}]; - [arrowPath addLineToPoint: (CGPoint){arrowX0, arrowY0}]; - [arrowPath addLineToPoint: (CGPoint){arrowXM, arrowY1}]; - - [[UIColor colorWithRed:R1 green:G1 blue:B1 alpha:1] set]; - - Y1 -= kArrowSize; - - } else if (_arrowDirection == KxMenuViewArrowDirectionLeft) { - - const CGFloat arrowYM = _arrowPosition; - const CGFloat arrowX0 = X0; - const CGFloat arrowX1 = X0 + kArrowSize + kEmbedFix; - const CGFloat arrowY0 = arrowYM - kArrowSize;; - const CGFloat arrowY1 = arrowYM + kArrowSize; - - [arrowPath moveToPoint: (CGPoint){arrowX0, arrowYM}]; - [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY0}]; - [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY1}]; - [arrowPath addLineToPoint: (CGPoint){arrowX0, arrowYM}]; - - [[UIColor colorWithRed:R0 green:G0 blue:B0 alpha:1] set]; - - X0 += kArrowSize; - - } else if (_arrowDirection == KxMenuViewArrowDirectionRight) { - - const CGFloat arrowYM = _arrowPosition; - const CGFloat arrowX0 = X1; - const CGFloat arrowX1 = X1 - kArrowSize - kEmbedFix; - const CGFloat arrowY0 = arrowYM - kArrowSize;; - const CGFloat arrowY1 = arrowYM + kArrowSize; - - [arrowPath moveToPoint: (CGPoint){arrowX0, arrowYM}]; - [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY0}]; - [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY1}]; - [arrowPath addLineToPoint: (CGPoint){arrowX0, arrowYM}]; - - [[UIColor colorWithRed:R1 green:G1 blue:B1 alpha:1] set]; - - X1 -= kArrowSize; - } - - [arrowPath fill]; - - // render body - - const CGRect bodyFrame = {X0, Y0, X1 - X0, Y1 - Y0}; - - UIBezierPath *borderPath = [UIBezierPath bezierPathWithRoundedRect:bodyFrame - cornerRadius:8]; - - const CGFloat locations[] = {0, 1}; - const CGFloat components[] = { - R0, G0, B0, 1, - R1, G1, B1, 1, - }; - - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, - components, - locations, - sizeof(locations)/sizeof(locations[0])); - CGColorSpaceRelease(colorSpace); - - - [borderPath addClip]; - - CGPoint start, end; - - if (_arrowDirection == KxMenuViewArrowDirectionLeft || - _arrowDirection == KxMenuViewArrowDirectionRight) { - - start = (CGPoint){X0, Y0}; - end = (CGPoint){X1, Y0}; - - } else { - - start = (CGPoint){X0, Y0}; - end = (CGPoint){X0, Y1}; - } - - CGContextDrawLinearGradient(context, gradient, start, end, 0); - - CGGradientRelease(gradient); -} - -@end - -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - -static KxMenu *gMenu; -static UIColor *gTintColor; -static UIFont *gTitleFont; - -@implementation KxMenu { - - KxMenuView *_menuView; - BOOL _observing; -} - -+ (instancetype) sharedMenu -{ - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - - gMenu = [[KxMenu alloc] init]; - }); - return gMenu; -} - -- (id) init -{ - NSAssert(!gMenu, @"singleton object"); - - self = [super init]; - if (self) { - } - return self; -} - -- (void) dealloc -{ - if (_observing) { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - } -} - -- (void) showMenuInView:(UIView *)view - fromRect:(CGRect)rect - menuItems:(NSArray *)menuItems -{ - NSParameterAssert(view); - NSParameterAssert(menuItems.count); - - if (_menuView) { - - [_menuView dismissMenu:NO]; - _menuView = nil; - } - - if (!_observing) { - - _observing = YES; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(orientationWillChange:) - name:UIApplicationWillChangeStatusBarOrientationNotification - object:nil]; - } - - - _menuView = [[KxMenuView alloc] init]; - [_menuView showMenuInView:view fromRect:rect menuItems:menuItems]; -} - -- (void) dismissMenu -{ - if (_menuView) { - - [_menuView dismissMenu:NO]; - _menuView = nil; - } - - if (_observing) { - - _observing = NO; - [[NSNotificationCenter defaultCenter] removeObserver:self]; - } -} - -- (void) orientationWillChange: (NSNotification *) n -{ - [self dismissMenu]; -} - -+ (void) showMenuInView:(UIView *)view - fromRect:(CGRect)rect - menuItems:(NSArray *)menuItems -{ - [[self sharedMenu] showMenuInView:view fromRect:rect menuItems:menuItems]; -} - -+ (void) dismissMenu -{ - [[self sharedMenu] dismissMenu]; -} - -+ (UIColor *) tintColor -{ - return gTintColor; -} - -+ (void) setTintColor: (UIColor *) tintColor -{ - if (tintColor != gTintColor) { - gTintColor = tintColor; - } -} - -+ (UIFont *) titleFont -{ - return gTitleFont; -} - -+ (void) setTitleFont: (UIFont *) titleFont -{ - if (titleFont != gTitleFont) { - gTitleFont = titleFont; - } -} - -@end diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/SettingPageViewController.h b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/SettingPageViewController.h deleted file mode 100644 index b3cf53b..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/SettingPageViewController.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// SettingPageViewController.h -// uartadapter -// -// Created by isaiah on 9/1/15. -// Copyright (c) 2015 realtek. All rights reserved. -// - - -#import - -@interface SettingPageViewController : UIViewController< -UIPickerViewDataSource, -UIPickerViewDelegate, -UITextFieldDelegate, -NSStreamDelegate, -NSNetServiceBrowserDelegate, -NSNetServiceDelegate, -UIAlertViewDelegate> -{ - -} - -+ (void) initSettingIOTInfoArray; -+ (void) copyIOTInfo:(NSNetService *)mService; - -@property (nonatomic, retain) NSData *allSettings; -@property (nonatomic, retain) NSInputStream *inputStream; -@property (nonatomic, retain) NSOutputStream *outputStream; -//@property (nonatomic, retain) NSMutableArray *settingIOTInfoArray; -@property (nonatomic, retain) NSNetService *selectedService; -@property (nonatomic, assign) NSInteger selectedGroupID; -@property (nonatomic, retain) IBOutlet UITextField *baudRateField; -@property (nonatomic, retain) IBOutlet UITextField *dataBitField; -@property (nonatomic, retain) IBOutlet UITextField *parityBitField; -@property (nonatomic, retain) IBOutlet UITextField *stopBitField; -//@property (nonatomic, retain) IBOutlet UIPickerView *datapicker; - -- (IBAction) saveSettings; -- (IBAction) restoreSettings; - -@end - - - - diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/SettingPageViewController.m b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/SettingPageViewController.m deleted file mode 100644 index b66980f..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/SettingPageViewController.m +++ /dev/null @@ -1,580 +0,0 @@ -// -// SettingPageViewController.m -// uartadapter -// -// Created by isaiah on 9/1/15. -// Copyright (c) 2015 realtek. All rights reserved. -// - -//#import -#import "ViewController.h" -#import "SettingPageViewController.h" -#include -#include - - -uint8_t const cmdPrefix[] = { 0x41, 0x4D, 0x45, 0x42, 0x41, 0x5F, 0x55, 0x41, 0x52, 0x54 };; -uint8_t const cmdGetAllSetting[] = { 0x02, 0x00, 0x0f }; - -NSMutableArray *settingIOTInfoArray; - -@interface SettingPageViewController () - -@end - - - -@implementation SettingPageViewController - - -@synthesize inputStream, outputStream; -@synthesize selectedService = _selectedService; -@synthesize baudRateField, dataBitField, parityBitField, stopBitField; -@synthesize allSettings = _allSettings; -//@synthesize datapicker; - - -//UIAlertView *alert; - -NSArray * baurateData ; -NSArray * bitData; -NSArray * parityBitData; -NSArray * stopBitdata; - -int mBardRate = 0; -int mDataBit = 0; -int mParityBit = 0; -int mStopBit = 0; - - -UIPickerView *datapicker; -int mTextFieldTag = -1; - -- (void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; - - self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]]; - - - baurateData = [[NSArray alloc] initWithObjects:@"1200", @"9600", @"14400", @"19200", @"28800", @"38400", @"57600", @"76800", @"115200", @"128000", @"153600", @"230400", @"460800", @"500000", @"921600", nil]; - bitData = [[NSArray alloc] initWithObjects:@"7", @"8", nil]; - parityBitData = [[NSArray alloc] initWithObjects:@"none", @"odd", @"even", nil]; - stopBitdata = [[NSArray alloc] initWithObjects:@"none", @"1", nil]; - - datapicker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 50, 100, 150)]; - [datapicker setDataSource: self]; - [datapicker setDelegate: self]; - [baudRateField setDelegate:self]; - [dataBitField setDelegate:self]; - [parityBitField setDelegate:self]; - [stopBitField setDelegate:self]; - - datapicker.showsSelectionIndicator = YES; - - self.baudRateField.inputView = datapicker; - self.dataBitField.inputView = datapicker; - self.parityBitField.inputView = datapicker; - self.stopBitField.inputView = datapicker; - - if([self inputStreamReceivedParser:self.allSettings] == 1)//update ui - { - self.baudRateField.text = [NSString stringWithFormat:@"%d",mBardRate]; - - self.dataBitField.text = [NSString stringWithFormat:@"%d",mDataBit]; - - if (mParityBit == 0) - self.parityBitField.text = @"none"; - else if (mParityBit == 1) - self.parityBitField.text = @"odd"; - else if (mParityBit == 2) - self.parityBitField.text = @"even"; - - if (mStopBit == 0) - self.stopBitField.text = @"none"; - else if (mStopBit == 1) - self.stopBitField.text = @"1"; - - // [alert dismissWithClickedButtonIndex:0 animated:YES]; - - } - - //[self prepareForInitNetworkCommunication]; - /* - alert = [[UIAlertView alloc] initWithTitle:@"UART Adapter" message:@"Connecting" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; - UIActivityIndicatorView * alertIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125.0, 00.0, 30.0, 30.0) ]; - alertIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; - //alertIndicator.center = CGPointMake(alert.bounds.size.width/2 , (alert.bounds.size.height/2) + 10); - - [alertIndicator startAnimating]; - - if ([[[UIDevice currentDevice] systemVersion]compare:@"7.0"] != NSOrderedAscending) - [alert setValue:alertIndicator forKey:@"accessoryView"]; - else - [alert addSubview:alertIndicator]; - // [alert show]; - */ - /* - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [self queryAllSettings]; - }); - */ - - -} - - - -- (IBAction) restoreSettings -{ - self.baudRateField.text = [NSString stringWithFormat:@"%d",mBardRate]; - self.dataBitField.text = [NSString stringWithFormat:@"%d",mDataBit]; - - if (mParityBit == 0) - self.parityBitField.text = @"none"; - else if (mParityBit == 1) - self.parityBitField.text = @"odd"; - else if (mParityBit == 2) - self.parityBitField.text = @"even"; - - if (mStopBit == 0) - self.stopBitField.text = @"none"; - else if (mStopBit == 1) - self.stopBitField.text = @"1"; - [datapicker reloadAllComponents]; -} - -- (IBAction) saveSettings{ - - NSString * stringTxtField; - uint8_t cmdReq[] = {0x00}; - uint8_t *cmdBaudrate = NULL; - uint8_t *cmdDatabit = NULL; - uint8_t *cmdParity = NULL; - uint8_t *cmdStopbit = NULL; - - - stringTxtField = self.baudRateField.text; - - if([stringTxtField isEqualToString:@"1200"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0xB0, 0x04, 0x00, 0x00 }; - }else if([stringTxtField isEqualToString:@"9600"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x80, 0x25, 0x00, 0x00 }; - }else if([stringTxtField isEqualToString:@"14400"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x40, 0x38, 0x00, 0x00 }; - }else if([stringTxtField isEqualToString:@"19200"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x00, 0x4B, 0x00, 0x00 }; - }else if([stringTxtField isEqualToString:@"28800"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x80, 0x70, 0x00, 0x00 }; - }else if([stringTxtField isEqualToString:@"38400"]){ - cmdBaudrate = (uint8_t []){ 0x00, 0x01, 0x04, 0x00, 0x96, 0x00, 0x00 }; - }else if([stringTxtField isEqualToString:@"57600"]){ - cmdBaudrate = (uint8_t []){ 0x00, 0x01, 0x04, 0x00, 0xE1, 0x00, 0x00 }; - }else if([stringTxtField isEqualToString:@"76800"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x00, 0x2C, 0x01, 0x00 }; - }else if([stringTxtField isEqualToString:@"115200"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x00, 0xC2, 0x01, 0x00 }; - }else if([stringTxtField isEqualToString:@"128000"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x00, 0xF4, 0x01, 0x00 }; - }else if([stringTxtField isEqualToString:@"153600"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x00, 0x58, 0x02, 0x00 }; - }else if([stringTxtField isEqualToString:@"230400"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x00, 0x84, 0x03, 0x00 }; - }else if([stringTxtField isEqualToString:@"460800"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x00, 0x08, 0x07, 0x00 }; - }else if([stringTxtField isEqualToString:@"500000"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x20, 0xA1, 0x07, 0x00 }; - }else if([stringTxtField isEqualToString:@"921600"]){ - cmdBaudrate = (uint8_t []) { 0x00, 0x01, 0x04, 0x00, 0x10, 0x0E, 0x00 }; - } - - stringTxtField = self.dataBitField.text; - if([stringTxtField isEqualToString:@"8"]){ - cmdDatabit = (uint8_t []) { 0x00, 0x02, 0x01, 0x08 }; - }else{ - cmdDatabit = (uint8_t []) { 0x00, 0x02, 0x01, 0x07 }; - } - - stringTxtField = self.parityBitField.text; - if([stringTxtField isEqualToString:@"none"]){ - cmdParity = (uint8_t []) { 0x00, 0x04, 0x01, 0x00 }; - }else if([stringTxtField isEqualToString:@"odd"]){ - cmdParity = (uint8_t []) { 0x00, 0x04, 0x01, 0x01 }; - }else if([stringTxtField isEqualToString:@"even"]){ - cmdParity = (uint8_t []) { 0x00, 0x04, 0x01, 0x02 }; - } - - stringTxtField = self.stopBitField.text; - if([stringTxtField isEqualToString:@"none"]){ - cmdStopbit = (uint8_t []) { 0x00, 0x08, 0x01, 0x00 }; - }else if([stringTxtField isEqualToString:@"1"]){ - cmdStopbit = (uint8_t []) { 0x00, 0x08, 0x01, 0x01 }; - } - - - NSMutableData *cmdSetSettings = [[NSMutableData alloc] initWithBytes:cmdPrefix length:sizeof(cmdPrefix)]; - [cmdSetSettings appendBytes:cmdReq length:1]; - [cmdSetSettings appendBytes:cmdBaudrate length:7]; - [cmdSetSettings appendBytes:cmdDatabit length:4]; - [cmdSetSettings appendBytes:cmdParity length:4]; - [cmdSetSettings appendBytes:cmdStopbit length:4]; - - - - - if (self.selectedGroupID != 0) { - - for (int i=0 ; i < settingIOTInfoArray.count; i++) { - NSNetService * groupIOTDevice = [settingIOTInfoArray objectAtIndex:i]; - - - - [self prepareForInitNetworkCommunication:[groupIOTDevice.addresses objectAtIndex:0 ] Port:(int)groupIOTDevice.port]; - [outputStream write:[cmdSetSettings bytes] maxLength:[cmdSetSettings length]]; - - } - - }else{ - - [self prepareForInitNetworkCommunication:[self.selectedService.addresses objectAtIndex:0 ] Port:(int)self.selectedService.port]; - [outputStream write:[cmdSetSettings bytes] maxLength:[cmdSetSettings length]]; - - } - -} - -+ (void) initSettingIOTInfoArray -{ - settingIOTInfoArray = [[NSMutableArray alloc] init]; -} - -+ (void) copyIOTInfo:(NSNetService *)mService -{ - - - [settingIOTInfoArray addObject:mService]; - // struct _IOTInfo IOTInfo; - //settingIOTInfoArray = [[NSMutableArray alloc] init]; - - // for (int i = 0; i < mIOTInfoArray.count; i++) { - // [[mIOTInfoArray objectAtIndex:i] getValue:&IOTInfo]; - - // [settingIOTInfoArray addObject:[NSValue valueWithBytes:&IOTInfo objCType:@encode(struct _IOTInfo)]]; - //} - -} - -- (void) queryAllSettings { - - NSMutableData *cmd = [[NSMutableData alloc] initWithBytes:cmdPrefix length:sizeof(cmdPrefix)]; - [cmd appendBytes:cmdGetAllSetting length:sizeof(cmdGetAllSetting)]; - [outputStream write:[cmd bytes] maxLength:[cmd length]]; - -} - - - -- (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent { - - - - switch (streamEvent) { - - case NSStreamEventOpenCompleted: - NSLog(@"Stream opened"); - break; - case NSStreamEventHasBytesAvailable: - - if (theStream == inputStream) { - - uint8_t buffer[64] = {0}; - int len; - - while ([inputStream hasBytesAvailable]) { - len = [[NSNumber numberWithInteger:[inputStream read:buffer maxLength: sizeof(buffer)]] intValue] ; - if (len > 0) { - - NSData *output = [[NSData alloc] initWithBytes:buffer length:len]; - - - if (nil != output) { - - - if([self inputStreamReceivedParser:output] == 1)//update ui - { - self.baudRateField.text = [NSString stringWithFormat:@"%d",mBardRate]; - - self.dataBitField.text = [NSString stringWithFormat:@"%d",mDataBit]; - - if (mParityBit == 0) - self.parityBitField.text = @"none"; - else if (mParityBit == 1) - self.parityBitField.text = @"odd"; - else if (mParityBit == 2) - self.parityBitField.text = @"even"; - - if (mStopBit == 0) - self.stopBitField.text = @"none"; - else if (mStopBit == 1) - self.stopBitField.text = @"1"; - - - - - - } - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Serial Port Setup" message:@"Success!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; - [alert show]; - - } - } - } - } - break; - - - case NSStreamEventErrorOccurred: - - NSLog(@"Can not connect to the host!"); - break; - - case NSStreamEventEndEncountered: - - [theStream close]; - [theStream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - //[theStream release]; - theStream = nil; - - break; - default: - NSLog(@"Unknown event"); - } - -} - -- (int) inputStreamReceivedParser:(NSData *)message { - - uint8_t *recvCmd = (uint8_t *)[message bytes] ; - - if ([self checkPrefix:recvCmd]){ - int readbit = 10; - - if (recvCmd[readbit] == 0x01) { //response for ack - return 0;//ok - }else if (recvCmd[readbit] == 0x03) { //response for getting - mBardRate = 0; - mDataBit = 0; - mParityBit = 0; - mStopBit = 0; - - readbit+=2; - do{ - - if (recvCmd[readbit] == 0x01) { //baudrate - int bit = 0; - int tmp = 0; - - int byteLen = recvCmd[++readbit]; - readbit++; - - for (int i=readbit; i < (readbit+byteLen); i++) { - - tmp = (recvCmd[i] & 0xFF) << (8*bit); - mBardRate += tmp; - bit++; - } - readbit+=(byteLen+1); - - - }else if (recvCmd[readbit] == 0x02) { //data - int byteLen = recvCmd[++readbit]; - readbit++; - - if (byteLen == 1) - mDataBit = recvCmd[readbit]; - else{ - - return -1; - } - readbit+=(byteLen+1); - - }else if (recvCmd[readbit] == 0x04) { //parity - int byteLen = recvCmd[++readbit]; - readbit++; - - if (byteLen == 1) - mParityBit = recvCmd[readbit]; - else{ - - return -1; - } - readbit+=(byteLen+1); - - }else if (recvCmd[readbit] == 0x08) { //stopbit - int byteLen = recvCmd[++readbit]; - readbit++; - - if (byteLen == 1) - mStopBit = recvCmd[readbit]; - else{ - - return -1; - } - readbit+=(byteLen+1); - - }else - readbit++; - }while (readbit < [message length]); - return 1;//update UI - }//if (recvCmd[readbit] == 0x01) - - - - } - return 2;//other -} - -- (Boolean) checkPrefix:(uint8_t *) recvPrefix -{ - for (int i = 0; i < sizeof(cmdPrefix); i++) { - if(recvPrefix[i] != cmdPrefix[i]) - return false; - } - return true; -} - --(void)prepareForInitNetworkCommunication:(NSData *)mAddress Port:(int)mPort { - - NSData *address = mAddress; - char addressString[INET6_ADDRSTRLEN]; - int inetType; - - struct sockaddr_in6 addr6; - memcpy(&addr6, address.bytes, address.length); - - if (address.length == 16) { // IPv4 - inetType = AF_INET; - struct sockaddr_in addr4; - memcpy(&addr4, address.bytes, address.length); - inet_ntop(AF_INET, &addr4.sin_addr, addressString, 512); - [self initNetworkCommunication:[NSString stringWithCString:addressString encoding:NSASCIIStringEncoding] Port:mPort]; - - } - - -} - - -- (void) initNetworkCommunication:(NSString *)mIP Port:(int)mPort { - - CFReadStreamRef readStream; - CFWriteStreamRef writeStream; - CFStreamCreatePairWithSocketToHost(NULL, (__bridge CFStringRef)mIP, mPort, &readStream, &writeStream); - - inputStream = (__bridge NSInputStream *)readStream; - outputStream = (__bridge NSOutputStream *)writeStream; - [inputStream setDelegate:self]; - [outputStream setDelegate:self]; - [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - [inputStream open]; - [outputStream open]; - -} - -- (void)textFieldDidBeginEditing:(UITextField *)textField -{ - mTextFieldTag = (int)textField.tag; - - [datapicker reloadAllComponents]; - -} - -- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component -{ - switch (mTextFieldTag) { - case 0: - self.baudRateField.text = baurateData[row]; - break; - case 1: - self.dataBitField.text = bitData[row]; - break; - case 2: - self.parityBitField.text = parityBitData[row]; - break; - case 3: - self.stopBitField.text = stopBitdata[row]; - break; - default: - break; - } - - [[self view] endEditing:YES]; -} - -- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component -{ - - switch (mTextFieldTag) { - case 0: - return baurateData[row]; - break; - case 1: - return bitData[row]; - break; - case 2: - return parityBitData[row]; - break; - case 3: - return stopBitdata[row]; - break; - default: - return 0; - break; - } - - -} - -- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView -{ - return 1 ; -} - -- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component -{ - switch (mTextFieldTag) { - case 0: - return baurateData.count; - break; - case 1: - return bitData.count; - break; - case 2: - return parityBitData.count; - break; - case 3: - return stopBitdata.count; - break; - default: - return 0; - break; - } - -} - - -- (void)viewDidUnload { - [super viewDidUnload]; - settingIOTInfoArray = nil; -} - -- (void)dealloc -{ - [inputStream close]; - [outputStream close]; - self.selectedService = nil; - settingIOTInfoArray = nil; -} - -@end \ No newline at end of file diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ViewController.h b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ViewController.h deleted file mode 100644 index c82291f..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ViewController.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// ViewController.h -// uartadapter -// -// Created by isaiah on 8/26/15. -// Copyright (c) 2015 realtek. All rights reserved. -// - -#import - -struct _IOTInfo { - __unsafe_unretained NSNetService *service; - __unsafe_unretained NSString *groupName; - NSInteger groupID; - -}; - -@interface ViewController : UICollectionViewController < /*UICollectionViewDelegateFlowLayout*/ NSNetServiceBrowserDelegate, -NSNetServiceDelegate, -UIAlertViewDelegate, -NSStreamDelegate, -NSNetServiceBrowserDelegate, -NSNetServiceDelegate, -UIGestureRecognizerDelegate> { - NSNetServiceBrowser *_netServiceBrowser; - NSMutableArray *_servicesArray; - NSNetService *_selectedService; -} - - -@property (nonatomic, retain) NSMutableArray *IOTInfoArray; -@property (nonatomic, retain) NSNetServiceBrowser *netServiceBrowser; -@property (nonatomic, retain) NSMutableArray *controlServicesArray; -@property (nonatomic, retain) NSMutableArray *dataServicesArray; -@property (nonatomic, retain) NSNetService *selectedService; - -- (IBAction) scanButton; - -@end - diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ViewController.m b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ViewController.m deleted file mode 100644 index 3daf274..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/ViewController.m +++ /dev/null @@ -1,1033 +0,0 @@ -/* - Copyright (C) 2015 Apple Inc. All Rights Reserved. - See LICENSE.txt for this sample’s licensing information - - Abstract: - The primary view controller for this app. - */ - -#import "ViewController.h" -#import "ChatViewController.h" -#import "Cell.h" -#import "KxMenu.h" -#import "SettingPageViewController.h" -#include -#include - - - -uint8_t const mCmdPrefix[] = { 0x41, 0x4D, 0x45, 0x42, 0x41, 0x5F, 0x55, 0x41, 0x52, 0x54 }; -uint8_t const mCmdGetAllSetting[] = { 0x02, 0x00, 0x0f }; -uint8_t const unGroupCommand[] = { 0x00, 0x00, 0x20, 0x02, 0x1f, 0x41, 0x01, 0x00, 0x01, 0x00 }; -uint8_t const serverCreatCommand[] = { 0x00, 0x00, 0x10, 0x02, 0x1f, 0x41 }; -uint8_t const serverConnectCommand[] = { 0x00, 0x40, 0x06 }; -uint8_t const portTOByte[] = { 0x1f, 0x41 }; -uint8_t const groupCmd[] = { 0x00, 0x01, 0x00, 0x01 }; -char gAddressString[INET6_ADDRSTRLEN]; - -NSUInteger IDforGroup = 1; -NSInteger IDforUnGroup = -1; -NSString *kDetailedViewControllerID = @"DetailView"; // view controller storyboard id -NSString *kCellID = @"cellID"; // UICollectionViewCell storyboard id -NSInteger maxDeviceNumber = 32; -NSString *UART_CONTROL_TYPE=@"_uart_control._tcp.local."; -UICollectionViewLayoutAttributes *collectionCell; -Boolean isFindServiceDone = FALSE; -UIImageView *dragImageView; -NSString * mBrowserType; -NSTimer * scanTimer; -int scancount = 0; - -UIAlertView *alert; -NSOutputStream *outputStream; -NSInputStream *inputStream; -NSData *output; -NSIndexPath *longPressIndexPath; - -//NSMutableArray *IOTInfoArray; -NSMutableArray *IOTItemListArray; - -@implementation ViewController - -@synthesize IOTInfoArray = _IOTInfoArray; -@synthesize netServiceBrowser = _netServiceBrowser; -@synthesize controlServicesArray = _controlServicesArray; -@synthesize dataServicesArray = _dataServicesArray; -@synthesize selectedService = _selectedService; - - -- (void)viewDidLoad -{ - [super viewDidLoad]; - - UIGraphicsBeginImageContext(self.view.frame.size); - [[UIImage imageNamed:@"background.png"] drawInRect:self.view.bounds]; - UIImage *bgImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - UIView * bgView = [UIView new]; - - bgView.backgroundColor = [UIColor colorWithPatternImage:bgImage]; - //bgView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]]; - bgView.contentMode = UIViewContentModeScaleToFill; - self.collectionView.backgroundView = bgView; - _IOTInfoArray = [[NSMutableArray alloc] init]; - IOTItemListArray = [[NSMutableArray alloc] init]; - self.dataServicesArray = [[NSMutableArray alloc] init]; - self.title = @"Uart Adapter"; - output = nil; - // self.netServiceBrowser = [[NSNetServiceBrowser alloc] init]; - // self.netServiceBrowser.delegate = self; - - //NSString *browseType; - // if (self.selectedService == nil) { - // browseType = @"_services._dns-sd._udp."; - // self.title = @"Bonjour Browser"; - // } else { - // NSString *fullDomainName = [NSString stringWithFormat:@"%@.%@", self.selectedService.name, self.selectedService.type]; - - // } - - //[NSThread detachNewThreadSelector:@selector(startDiscover:) toTarget:self withObject:UART_CONTROL_TYPE]; - [self startDiscover:UART_CONTROL_TYPE]; - // [self.netServiceBrowser stop]; - //self.netServiceBrowser = [[NSNetServiceBrowser alloc] init]; - //self.netServiceBrowser.delegate = self; - //[self startDiscover:UART_DATA_TYPE]; - UILongPressGestureRecognizer *lpgr - = [[UILongPressGestureRecognizer alloc] - initWithTarget:self action:@selector(handleLongPress:)]; - lpgr.minimumPressDuration = .5; //seconds - lpgr.delegate = self; - lpgr.delaysTouchesBegan = YES; - [self.collectionView addGestureRecognizer:lpgr]; -} - -- (IBAction) scanButton { - scancount = 0; - - - [self closeDiscover]; - - [self startDiscover:UART_CONTROL_TYPE]; - -} - --(void)handleLongPress:(UIGestureRecognizer *)gestureRecognizer -{ - if (gestureRecognizer.state != UIGestureRecognizerStateBegan) { - return; - } - CGPoint p = [gestureRecognizer locationInView:self.collectionView]; - - longPressIndexPath = [self.collectionView indexPathForItemAtPoint:p]; - if (longPressIndexPath == nil){ - NSLog(@"couldn't find index path"); - } else { - // get the cell at indexPath (the one you long pressed) - collectionCell = [self.collectionView layoutAttributesForItemAtIndexPath:longPressIndexPath]; - - struct _IOTInfo IOTItemLongPressed; - [[IOTItemListArray objectAtIndex:longPressIndexPath.row] getValue:&IOTItemLongPressed]; - - [self showMenu:IOTItemLongPressed.groupID]; - - } -} - - -- (void)didLongPressCell:(UIPanGestureRecognizer *)sender -{ - NSInteger tag = sender.view.tag; - - CGPoint pressPoint = [sender locationInView:self.view]; - - UIImage *img; - Cell *dragCell; - CGFloat w, h; - CGFloat centerX, centerY; - - for (id view in self.collectionView.subviews) { - if ([view isKindOfClass:[Cell class]]) { - Cell *cc = (Cell *)view; - if (cc.tag == tag) { - dragCell = cc; - break; - } - } - } - - w = dragCell.image.bounds.size.width ;// 88; - h = dragCell.image.bounds.size.height;//84; - centerX = pressPoint.x-w/2; - centerY = pressPoint.y-h/2; - - if (sender.state == UIGestureRecognizerStateBegan) { - - dragImageView = [[UIImageView alloc] initWithFrame:CGRectMake(centerX, centerY, w, h)]; - dragImageView.layer.shadowColor = [[UIColor blackColor] CGColor]; - dragImageView.layer.shadowOffset = CGSizeMake(2, 2); - dragImageView.layer.shadowOpacity = 0.4f; - dragImageView.image = dragCell.image.image; - [self.view addSubview:dragImageView]; - - dragCell.hidden = YES; - } - - if (sender.state == UIGestureRecognizerStateChanged) { - - dragImageView.frame = CGRectMake(centerX, centerY, w, h); - - - - } - - if (sender.state == UIGestureRecognizerStateEnded) { - - - - - img = nil; - dragImageView.image = nil; - [dragImageView removeFromSuperview]; - - dragCell.hidden = NO; - - - - - for (id view in self.collectionView.subviews) { - if ([view isKindOfClass:[Cell class]]) { - Cell *overlapCell = (Cell *)view; - if (overlapCell.tag != tag) { - - dispatch_async(dispatch_get_main_queue(), ^{ - alert = [[UIAlertView alloc] initWithTitle:@"UART Adapter" message:@"Groupping" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; - [alert show]; - }); - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^(void){ - [alert dismissWithClickedButtonIndex:2 animated:YES]; - }); - - CGFloat minX = overlapCell.frame.origin.x - w; - CGFloat maxX = overlapCell.frame.origin.x + overlapCell.frame.size.width; - CGFloat minY = overlapCell.frame.origin.y - h; - CGFloat maxY = overlapCell.frame.origin.y + overlapCell.frame.size.height; - - if ((minX <= centerX && centerX <= maxX) && (minY <= centerY && centerY <= maxY)) { - - - - - - char source[INET6_ADDRSTRLEN], destination[INET6_ADDRSTRLEN]; - - struct _IOTInfo IOTDevice; - bool idIsEqual; - - - do{ - idIsEqual = false; - for (int i = 0; i < IOTItemListArray.count; i++) { - [[IOTItemListArray objectAtIndex:i] getValue:&IOTDevice]; - if (IOTDevice.groupID == IDforGroup && IOTDevice.groupID != 0) { - idIsEqual = true; - IDforGroup++; - break; - } - } - }while (idIsEqual /*|| IOTItemListArray.count <= dragCell.tag*/); - - [[IOTItemListArray objectAtIndex:dragCell.tag] getValue:&IOTDevice]; - [self prepareForInitNetworkCommunication:[IOTDevice.service.addresses objectAtIndex:0 ] Port:(int)IOTDevice.service.port]; - [self devicePerformAction:1 GroupID:-1 Target:nil ]; - [inputStream close]; - [outputStream close]; - - memcpy(source, gAddressString, INET6_ADDRSTRLEN); - - [[IOTItemListArray objectAtIndex:overlapCell.tag] getValue:&IOTDevice]; - [self prepareForInitNetworkCommunication:[IOTDevice.service.addresses objectAtIndex:0 ] Port:(int)IOTDevice.service.port]; - [self devicePerformAction:1 GroupID:-1 Target:nil ]; - [inputStream close]; - [outputStream close]; - - memcpy(destination, gAddressString, INET6_ADDRSTRLEN); - - [[IOTItemListArray objectAtIndex:dragCell.tag] getValue:&IOTDevice]; - [self prepareForInitNetworkCommunication:[IOTDevice.service.addresses objectAtIndex:0 ] Port:(int)IOTDevice.service.port]; - [self devicePerformAction:2 GroupID:IDforGroup Target:destination]; - [inputStream close]; - [outputStream close]; - - [[IOTItemListArray objectAtIndex:overlapCell.tag] getValue:&IOTDevice]; - [self prepareForInitNetworkCommunication:[IOTDevice.service.addresses objectAtIndex:0 ] Port:(int)IOTDevice.service.port]; - [self devicePerformAction:2 GroupID:IDforGroup Target:source]; - [inputStream close]; - [outputStream close]; - - - - break; - } - - - } - } - - } - - //IOTItemListArray=nil; - //[self.collectionView reloadData]; - //[self performSelector:@selector(scanButton)]; - //} - - - } -} - - --(void) startDiscover:(NSString *)browseType -{ - _IOTInfoArray = [[NSMutableArray alloc] init]; - IOTItemListArray = [[NSMutableArray alloc] init]; - - self.controlServicesArray = [[NSMutableArray alloc] init]; - self.netServiceBrowser = [[NSNetServiceBrowser alloc] init]; - self.netServiceBrowser.delegate = self; - - NSArray *domainNameParts = [browseType componentsSeparatedByString:@"."]; - - mBrowserType = [NSString stringWithFormat:@"%@.%@.", [domainNameParts objectAtIndex:0], [domainNameParts objectAtIndex:1]]; - alert = [[UIAlertView alloc] initWithTitle:@"UART Adapter" message:@"Scanning" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; - [alert show]; - - - [self.netServiceBrowser searchForServicesOfType:mBrowserType inDomain:@""]; - - scanTimer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(repeatScan:) userInfo:nil repeats:YES]; - - - -} - - -- (void) repeatScan:(NSTimer *) aTimer{ - - if(scancount >= 3){ - [scanTimer invalidate]; - [self.netServiceBrowser stop]; - self.netServiceBrowser.delegate = nil; - - [alert dismissWithClickedButtonIndex:1 animated:true]; - return; - } - - [self.netServiceBrowser stop]; - self.netServiceBrowser.delegate = nil; - - - - - - self.netServiceBrowser.delegate = self; - [self.netServiceBrowser searchForServicesOfType:mBrowserType inDomain:@""]; - scancount++; -} - --(void) closeDiscover -{ - [self.netServiceBrowser stop]; - - self.netServiceBrowser.delegate = nil; - self.netServiceBrowser = nil; - self.controlServicesArray = nil; - self.selectedService = nil; - _IOTInfoArray = nil; - [[self collectionView] reloadData]; -} - -- (NSInteger)collectionView:(UICollectionView *)view numberOfItemsInSection:(NSInteger)section; -{ - - return IOTItemListArray.count; -} - -- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath; -{ - struct _IOTInfo IOTDeviceItem; - NSString *imageToLoad; - - // we're going to use a custom UICollectionViewCell, which will hold an image and its label - // - Cell *cell = [cv dequeueReusableCellWithReuseIdentifier:kCellID forIndexPath:indexPath]; - - // make the cell's title the actual NSIndexPath value - - - - [[IOTItemListArray objectAtIndex:indexPath.row] getValue:&IOTDeviceItem]; - - if (IOTDeviceItem.groupID != 0) { - cell.label.text = IOTDeviceItem.groupName; - imageToLoad = @"ameba_group.png"; - }else{ - cell.label.text = IOTDeviceItem.service.name; - // load the image for this cell - imageToLoad = @"device.png"; - - } - cell.image.image = [UIImage imageNamed:imageToLoad]; - cell.tag = indexPath.row; - - UIPanGestureRecognizer *dragPressGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(didLongPressCell:)]; - - - [cell addGestureRecognizer:dragPressGesture]; - - - return cell; -} - -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath -{ - - - - struct _IOTInfo IOTDevice; - [[IOTItemListArray objectAtIndex:indexPath.row] getValue:&IOTDevice]; - self.selectedService = IOTDevice.service; - - collectionCell = [self.collectionView layoutAttributesForItemAtIndexPath:indexPath]; - - isFindServiceDone = FALSE; - - if (IOTDevice.groupID == 0) - [self pushToChat:nil]; - else - [[self collectionView] deselectItemAtIndexPath:indexPath animated:true]; -} - - -- (void)showMenu:(NSInteger)groupID -{ - - IDforUnGroup = groupID; - NSArray *menuItems = - @[ - [KxMenuItem menuItem:@"ACTION MENU" - image:nil - target:nil - action:NULL], - - [KxMenuItem menuItem:@"Setting" - image:[UIImage imageNamed:@"settings"] - target:self - action:@selector(pushToSetting:)], - ]; - - NSMutableArray *extraItems = [NSMutableArray arrayWithArray:menuItems]; - if (groupID != 0) { - [extraItems addObject:[KxMenuItem menuItem:@"UnGroup" - image:[UIImage imageNamed:@"ungroup"] - target:self - action:@selector(unGroup:)]]; - } - - - - KxMenuItem *first = menuItems[0]; - first.foreColor = [UIColor colorWithRed:47/255.0f green:112/255.0f blue:225/255.0f alpha:1.0]; - first.alignment = NSTextAlignmentCenter; - if (groupID != 0) - [KxMenu showMenuInView:self.view - fromRect:collectionCell.frame - menuItems:extraItems]; - else - [KxMenu showMenuInView:self.view - fromRect:collectionCell.frame - menuItems:menuItems]; - -} - --(void) unGroup:(id)sender -{ - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^(void){ - [alert dismissWithClickedButtonIndex:2 animated:YES]; - }); - dispatch_async(dispatch_get_main_queue(), ^{ - alert = [[UIAlertView alloc] initWithTitle:@"UART Adapter" message:@"Ungroupping" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; - [alert show]; - }); - - - - struct _IOTInfo IOTDevice; - - for (int i=0 ; i < _IOTInfoArray.count; i++) { - [[_IOTInfoArray objectAtIndex:i] getValue:&IOTDevice]; - - if (IOTDevice.groupID == IDforUnGroup) { - - [self prepareForInitNetworkCommunication:[IOTDevice.service.addresses objectAtIndex:0 ] Port:(int)IOTDevice.service.port]; - [self devicePerformAction:0 GroupID:-1 Target:nil]; - [inputStream close]; - [outputStream close]; - } - for (int i=0 ; i < IOTItemListArray.count; i++) { - [[IOTItemListArray objectAtIndex:i] getValue:&IOTDevice]; - - if(IOTDevice.groupID == IDforUnGroup) - [IOTItemListArray removeObjectAtIndex:i]; - } - - } - - - // [self.collectionView reloadData]; - - // - //[self performSelector:@selector(scanButton)]; - - -} - - -- (void) pushToSetting:(id)sender -{ - - - - - - alert = [[UIAlertView alloc] initWithTitle:@"UART Adapter" message:@"Connecting" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; - - [alert show]; - - - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void){ - - self.selectedService = self.controlServicesArray[longPressIndexPath.row]; - - while ( self.selectedService.port < 0 ) { - [self.selectedService resolveWithTimeout:5.0]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 5.0 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void){ - self.selectedService = self.controlServicesArray[longPressIndexPath.row]; - - }); - } - - [self prepareForInitNetworkCommunication:[self.selectedService.addresses objectAtIndex:0] Port:(int)self.selectedService.port]; - - [self queryAllSettings]; - - }); - -} - - -- (void) pushToChat:(id)sender -{ -// NSIndexPath *selectedIndexPath = [self.collectionView indexPathsForSelectedItems][0]; -// ChatViewController *chatVC = [[ChatViewController alloc] init]; -// chatVC.selectedService = self.controlServicesArray[selectedIndexPath.row ]; - [self performSegueWithIdentifier:@"showDetail" sender:sender]; - //[self presentViewController:detailViewController animated:YES completion:nil]; - -} - - -- (void) queryAllSettings { - - NSMutableData *cmd = [[NSMutableData alloc] initWithBytes:mCmdPrefix length:sizeof(mCmdPrefix)]; - [cmd appendBytes:mCmdGetAllSetting length:sizeof(mCmdGetAllSetting)]; - [outputStream write:[cmd bytes] maxLength:[cmd length]]; - -} - -- (void) devicePerformAction:(NSInteger)type GroupID:(NSInteger)groupID Target:(char *)iAddress -{ - - uint8_t gID[] = {(uint8_t)groupID}; - NSMutableData *cmd = [[NSMutableData alloc] initWithBytes:mCmdPrefix length:sizeof(mCmdPrefix)]; - switch (type) { - - case 0: // ungroup - - [cmd appendBytes:unGroupCommand length:sizeof(unGroupCommand)]; - break; - case 1: // server create - [cmd appendBytes:serverCreatCommand length:sizeof(serverCreatCommand)]; - break; - case 2: // group - - uint8_t ip[4] = {0}; - char *marker, *ret; - - ret = strtok_r(iAddress, ".", &marker); - ip[0] = (uint8_t)strtod(ret, NULL); - ret = strtok_r(NULL, ".", &marker); - ip[1] = (uint8_t)strtod(ret, NULL); - ret = strtok_r(NULL, ".", &marker); - ip[2] = (uint8_t)strtod(ret, NULL); - ret = strtok_r(NULL, ".", &marker); - ip[3] = (uint8_t)strtod(ret, NULL); - ret = strtok_r(NULL, ".", &marker); - - - [cmd appendBytes:groupCmd length:sizeof(groupCmd)]; - [cmd appendBytes:gID length:sizeof(gID)]; - [cmd appendBytes:serverConnectCommand length:sizeof(serverConnectCommand)]; - [cmd appendBytes:ip length:sizeof(ip)]; - [cmd appendBytes:portTOByte length:sizeof(portTOByte)]; - - - - break; - - default: - break; - } - [outputStream write:[cmd bytes] maxLength:[cmd length]]; - -} - - --(void)prepareForInitNetworkCommunication:(NSData *)mAddress Port:(int)mPort { - - NSData *address = mAddress; - char addressString[INET6_ADDRSTRLEN]; - int inetType; - - struct sockaddr_in6 addr6; - memcpy(&addr6, address.bytes, address.length); - - if (address.length == 16) { // IPv4 - inetType = AF_INET; - struct sockaddr_in addr4; - memcpy(&addr4, address.bytes, address.length); - inet_ntop(AF_INET, &addr4.sin_addr, addressString, 512); - inet_ntop(AF_INET, &addr4.sin_addr, gAddressString, 512); - [self initNetworkCommunication:[NSString stringWithCString:addressString encoding:NSASCIIStringEncoding] Port:mPort]; - - } - - -} - - -- (void) initNetworkCommunication:(NSString *)mIP Port:(int)mPort { - - CFReadStreamRef readStream; - CFWriteStreamRef writeStream; - CFStreamCreatePairWithSocketToHost(NULL, (__bridge CFStringRef)mIP, mPort, &readStream, &writeStream); - - inputStream = (__bridge NSInputStream *)readStream; - outputStream = (__bridge NSOutputStream *)writeStream; - [inputStream setDelegate:self]; - [outputStream setDelegate:self]; - [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - [inputStream open]; - [outputStream open]; - -} -/* -- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex -{ - if(buttonIndex == [alertView cancelButtonIndex]){ - scancount = 12; - - [alertView dismissWithClickedButtonIndex:2 animated:YES]; - } -} -*/ -- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex -{ - if (buttonIndex == 0) { - scancount = 12; - [scanTimer invalidate]; - }else if (buttonIndex == 2) { - [self performSelector:@selector(scanButton)]; - - } - -} - - -- (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent { - - - - - switch (streamEvent) { - - case NSStreamEventOpenCompleted: - - if (alert != nil) - [alert dismissWithClickedButtonIndex:1 animated:true]; - break; - case NSStreamEventHasBytesAvailable: - - if (theStream == inputStream) { - - uint8_t buffer[64] = {0}; - int len; - - while ([inputStream hasBytesAvailable]) { - len = [[NSNumber numberWithInteger:[inputStream read:buffer maxLength: sizeof(buffer)]] intValue] ; - if (len > 0) { - - output = [[NSData alloc] initWithBytes:buffer length:len]; - - - if (nil != output) { - - - if([self inputStreamReceivedParser:output] == 1)//update ui - { - - [self performSegueWithIdentifier:@"showSetting" sender:nil]; - - } - - } - } - } - } - break; - - - case NSStreamEventErrorOccurred: - - NSLog(@"Can not connect to the host!"); - break; - - case NSStreamEventEndEncountered: - - [theStream close]; - [theStream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - - theStream = nil; - - break; - default: - NSLog(@"Unknown event"); - } - - - - -} - - -- (int) inputStreamReceivedParser:(NSData *)message { - - uint8_t *recvCmd = (uint8_t *)[message bytes] ; - - int mBardRate = 0; - int mDataBit = 0; - int mParityBit = 0; - int mStopBit = 0; - - - - if ([self checkPrefix:recvCmd]){ - int readbit = 10; - - if (recvCmd[readbit] == 0x01) { //response for ack - return 0;//ok - }else if (recvCmd[readbit] == 0x03) { //response for getting - mBardRate = 0; - mDataBit = 0; - mParityBit = 0; - mStopBit = 0; - - readbit+=2; - do{ - - if (recvCmd[readbit] == 0x01) { //baudrate - int bit = 0; - int tmp = 0; - - int byteLen = recvCmd[++readbit]; - readbit++; - - for (int i=readbit; i < (readbit+byteLen); i++) { - - tmp = (recvCmd[i] & 0xFF) << (8*bit); - mBardRate += tmp; - bit++; - } - readbit+=(byteLen+1); - - - }else if (recvCmd[readbit] == 0x02) { //data - int byteLen = recvCmd[++readbit]; - readbit++; - - if (byteLen == 1) - mDataBit = recvCmd[readbit]; - else{ - - return -1; - } - readbit+=(byteLen+1); - - }else if (recvCmd[readbit] == 0x04) { //parity - int byteLen = recvCmd[++readbit]; - readbit++; - - if (byteLen == 1) - mParityBit = recvCmd[readbit]; - else{ - - return -1; - } - readbit+=(byteLen+1); - - }else if (recvCmd[readbit] == 0x08) { //stopbit - int byteLen = recvCmd[++readbit]; - readbit++; - - if (byteLen == 1) - mStopBit = recvCmd[readbit]; - else{ - - return -1; - } - readbit+=(byteLen+1); - - }else - readbit++; - }while (readbit < [message length]); - - return 1;//update UI - }//if (recvCmd[readbit] == 0x01) - - - - } - return 2;//other -} - -- (Boolean) checkPrefix:(uint8_t *) recvPrefix -{ - for (int i = 0; i < sizeof(mCmdPrefix); i++) { - if(recvPrefix[i] != mCmdPrefix[i]) - return false; - } - return true; -} - -#pragma mark - -#pragma mark NSNetServiceBrowserDelegate methods --(void)netServiceBrowser:(NSNetServiceBrowser *)browser didNotSearch:(NSDictionary *)errorDict { - - self.netServiceBrowser.delegate = nil; - [self.netServiceBrowser stop]; - self.netServiceBrowser = nil; -} - --(void)netServiceBrowserDidStopSearch:(NSNetServiceBrowser *)browser { - - self.netServiceBrowser.delegate = nil; - self.netServiceBrowser = nil; -} - --(void)netServiceBrowser:(NSNetServiceBrowser *)aNetServiceBrowser didFindService:(NSNetService *)aNetService moreComing:(BOOL)moreComing { - - - [self.controlServicesArray addObject:aNetService]; - - aNetService.delegate = self; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void){ - [aNetService resolveWithTimeout:5.0]; - }); - - - - if (moreComing == NO) { - - - - NSSortDescriptor *sd = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; - [self.controlServicesArray sortUsingDescriptors:[NSArray arrayWithObject:sd]]; - - [self.netServiceBrowser stop]; - self.netServiceBrowser.delegate = nil; - self.netServiceBrowser = nil; - - [self.collectionView reloadData]; - isFindServiceDone = true; - } - -} - -- (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didRemoveService:(NSNetService *)netService moreComing:(BOOL)moreComing { - for (int i = 0; i < self.controlServicesArray.count; i++) { - if ([((NSNetService *)[self.controlServicesArray objectAtIndex:i]).name isEqualToString:netService.name]) { - [self.controlServicesArray removeObjectAtIndex:i]; - break; - } - } - if (moreComing == NO) { - [self.collectionView reloadData]; - - NSSortDescriptor *sd = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; - [self.controlServicesArray sortUsingDescriptors:[NSArray arrayWithObject:sd]]; - - } -} - -#pragma mark - -#pragma mark NSNetServiceDelegate methods --(void)netService:(NSNetService *)sender didNotResolve:(NSDictionary *)errorDict { - NSNumber *errorCode = [errorDict valueForKey:NSNetServicesErrorCode]; - - NSString *errorMessage; - switch ([errorCode intValue]) { - case NSNetServicesActivityInProgress: - errorMessage = @"Service Resolution Currently in Progress. Please Wait."; - break; - case NSNetServicesTimeoutError: - errorMessage = @"Service Resolution Timeout"; - - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void){ - [sender resolveWithTimeout:5.0]; - }); - break; - } - - - //[alert release]; -} - --(void)netServiceDidResolveAddress:(NSNetService *)service { - - NSString *textRecord; - static struct _IOTInfo IOTInfo; - struct _IOTInfo tmpIOTInfo; - - /* - if(self.netServiceBrowser == nil) - return; - */ - - for (int i = 0 ; i < self.controlServicesArray.count; i++) { - if ([service.name isEqualToString:[[self.controlServicesArray objectAtIndex:i] name]]) { - [self.controlServicesArray replaceObjectAtIndex:i withObject:service]; - - } - } - - textRecord = [[NSString alloc]initWithData:[service TXTRecordData] encoding:NSUTF8StringEncoding]; - IOTInfo.groupID = [[textRecord substringWithRange:NSMakeRange([textRecord rangeOfString:@"groupid:"].location + 8,[textRecord rangeOfString:@", tcpserver:"].location - [textRecord rangeOfString:@"groupid:"].location - 8 )] integerValue]; - - - IOTInfo.service = service; - if(IOTInfo.groupID != 0) - IOTInfo.groupName = IOTInfo.service.name; - [_IOTInfoArray addObject:[NSValue valueWithBytes:&IOTInfo objCType:@encode(struct _IOTInfo)]]; - - - for (int i=0; i < IOTItemListArray.count ; i++) { - [[IOTItemListArray objectAtIndex:i] getValue:&tmpIOTInfo]; - - if ( IOTInfo.groupID != 0 && tmpIOTInfo.groupID == IOTInfo.groupID ){ - - - - - return; - }else if( [[tmpIOTInfo.service name] isEqualToString:[service name] ]){ - return; - - } - - } - [IOTItemListArray addObject:[NSValue valueWithBytes:&IOTInfo objCType:@encode(struct _IOTInfo)]]; - [self.collectionView reloadData]; - - -} - -// the user tapped a collection item, load and set the image on the detail view controller -// - -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender -{ - isFindServiceDone = FALSE; - - - if ([segue.identifier isEqualToString:@"showDetail"]) - { - - - ChatViewController *chatVC = segue.destinationViewController; - - NSIndexPath *cvindex= [self.collectionView indexPathsForSelectedItems][0]; - chatVC.selectedService = self.selectedService;//self.controlServicesArray[cvindex.row ]; - - - }else if ([segue.identifier isEqualToString:@"showSetting"]) - { - - - struct _IOTInfo IOTDevice; - [[IOTItemListArray objectAtIndex:longPressIndexPath.row] getValue:&IOTDevice]; - - [SettingPageViewController initSettingIOTInfoArray]; - SettingPageViewController *settingVC = segue.destinationViewController; - settingVC.allSettings = output; - - settingVC.selectedGroupID = IOTDevice.groupID; - - if (IOTDevice.groupID == 0) { - - settingVC.selectedService = IOTDevice.service; - }else{ - - for (int i = 0; i < _IOTInfoArray.count; i++) { - [[_IOTInfoArray objectAtIndex:i] getValue:&IOTDevice]; - if (IOTDevice.groupID == settingVC.selectedGroupID) { - [SettingPageViewController copyIOTInfo:IOTDevice.service]; - } - } - } - - - - } - -} - -- (void)viewDidUnload { - [super viewDidUnload]; - [inputStream close]; - [outputStream close]; - self.netServiceBrowser.delegate = nil; - [self.netServiceBrowser stop]; - self.netServiceBrowser = nil; - // IOTInfoArray = nil; - IOTItemListArray = nil; -} - -- (void)dealloc -{ - [inputStream close]; - [outputStream close]; - self.netServiceBrowser = nil; - self.controlServicesArray = nil; - self.selectedService = nil; - //IOTInfoArray = nil; - IOTItemListArray = nil; - //[super dealloc]; -} - - -@end diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/main.m b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/main.m deleted file mode 100644 index 16f9aea..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// uartadapter -// -// Created by isaiah on 8/26/15. -// Copyright (c) 2015 realtek. All rights reserved. -// - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/settings.png b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/settings.png deleted file mode 100644 index 4dcd031..0000000 Binary files a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/settings.png and /dev/null differ diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/uartadapter-Prefix.pch b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/uartadapter-Prefix.pch deleted file mode 100644 index 0fba4e0..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapter/uartadapter-Prefix.pch +++ /dev/null @@ -1,14 +0,0 @@ -// -// Prefix header for all source files of the 'KxMenuExample' target in the 'KxMenuExample' project -// - -#import - -#ifndef __IPHONE_4_0 -#warning "This project uses features only available in iOS SDK 4.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapterTests/Info.plist b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapterTests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapterTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapterTests/uartadapterTests.m b/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapterTests/uartadapterTests.m deleted file mode 100644 index 676591d..0000000 --- a/sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0/tools/uart_adapter/app/iOS/uartadapterTests/uartadapterTests.m +++ /dev/null @@ -1,40 +0,0 @@ -// -// uartadapterTests.m -// uartadapterTests -// -// Created by isaiah on 8/26/15. -// Copyright (c) 2015 realtek. All rights reserved. -// - -#import -#import - -@interface uartadapterTests : XCTestCase - -@end - -@implementation uartadapterTests - -- (void)setUp { - [super setUp]; - // Put setup code here. This method is called before the invocation of each test method in the class. -} - -- (void)tearDown { - // Put teardown code here. This method is called after the invocation of each test method in the class. - [super tearDown]; -} - -- (void)testExample { - // This is an example of a functional test case. - XCTAssert(YES, @"Pass"); -} - -- (void)testPerformanceExample { - // This is an example of a performance test case. - [self measureBlock:^{ - // Put the code you want to measure the time of here. - }]; -} - -@end