static void OutputIpAddress(void) { NET_CONFIG* p_config; #if defined(ENABLE_STATIC_IP) char buf[64]; #endif p_config = GetNetworkConfig(); SYS_CONSOLE_MESSAGE("IP Address: "); #if defined(ENABLE_STATIC_IP) for (i = 0; i < 4; ++i) { sprintf(buf, "%d", (uint8_t)(p_config.MyIPAddr.Val >> (8 * i))); SYS_CONSOLE_MESSAGE(buf); if (i != 3) { SYS_CONSOLE_MESSAGE("."); } } SYS_CONSOLE_MESSAGE(" (static)\r\n"); #else SYS_CONSOLE_MESSAGE("via DHCP\r\n"); #endif }
// called from a system async event handler whenever g_easyConfigCtx.isWifiNeedToConfigure is true void WiFi_EasyConfigTask(void) { switch (g_easyConfigCtx.state) { case EZ_WAIT_FOR_START: SYS_CONSOLE_MESSAGE("EZ_WAIT_FOR_START\r\n"); g_easyConfigCtx.isWifiNeedToConfigure = false; // first thing to do is delay one second so user can see on the web // page that disconnect is about occur in process of connecting to // designated AP. So create and start timer. g_easyConfigCtx.timer = SYS_TICK_TimerCreate(EasyConfigTimerHandler); SYS_TICK_TimerSetRate(g_easyConfigCtx.timer, SYS_TICK_TicksPerSecondGet() * WF_EASY_CONFIG_DELAY_TIME); g_easyConfigCtx.state = EZ_WAIT_FOR_DELAY; break; case EZ_WAIT_FOR_DELAY: SYS_CONSOLE_MESSAGE("EZ_WAIT_FOR_DELAY\r\n"); g_easyConfigCtx.isWifiNeedToConfigure = false; // delete timer now that delay has occurred SYS_TICK_TimerDelete(g_easyConfigCtx.timer); // connect to AP that user selected on web page EasyConfigConnect(); g_easyConfigCtx.state = EZ_WAIT_FOR_START; break; } }
void APP_NVM_Write1(void) { int i; uint8_t buf_t[10]; char c_tmp = 0; for(i = 0;i<DRV_NVM_PAGE_SIZE;i++) { NVM_DATA_TEST_BUFF[i] = 0x55; } SYS_CONSOLE_MESSAGE("1. Open\r\n"); if(wifi_nvm_handle.nvmHandle == 0) { wifi_nvm_handle.nvmHandle = DRV_NVM_Open(0, DRV_IO_INTENT_READWRITE); if(DRV_HANDLE_INVALID == wifi_nvm_handle.nvmHandle){ SYS_ASSERT(DRV_HANDLE_INVALID != wifi_nvm_handle.nvmHandle,"Error Opening Driver");} } SYS_CONSOLE_MESSAGE("2. erase\r\n"); wifi_nvm_handle.nvmbufferHandle = DRV_NVM_Erase(wifi_nvm_handle.nvmHandle,(uint8_t*)NVM_WF_CONFIG__ADDRESS, DRV_NVM_PAGE_SIZE); if(DRV_NVM_BUFFER_HANDLE_INVALID == wifi_nvm_handle.nvmbufferHandle){SYS_ASSERT(false, "Driver Erase Failed");} while(DRV_NVM_BUFFER_COMPLETED != DRV_NVM_BufferStatus(wifi_nvm_handle.nvmHandle, wifi_nvm_handle.nvmbufferHandle)) { ;} SYS_CONSOLE_MESSAGE("3. Write\r\n"); wifi_nvm_handle.nvmbufferHandle = DRV_NVM_Write(wifi_nvm_handle.nvmHandle, (uint8_t *)(NVM_WF_CONFIG__ADDRESS), (uint8_t *)NVM_DATA_TEST_BUFF, DRV_NVM_ROW_SIZE); if(DRV_NVM_BUFFER_HANDLE_INVALID == wifi_nvm_handle.nvmbufferHandle){SYS_ASSERT(false, "Driver Writing Failed");} while(DRV_NVM_BUFFER_COMPLETED != DRV_NVM_BufferStatus(wifi_nvm_handle.nvmHandle, wifi_nvm_handle.nvmbufferHandle)){;} SYS_CONSOLE_MESSAGE("4. Done\r\n"); }
/******************************************************************************* Function: void WFConfigureLowPowerMode(uint8_t action) Summary: Driver function to configure PS Poll mode. Description: This function is only used by the driver, not the application. This function, other than at initialization, is only used when the application has enabled PS-Poll mode. This function is used to temporarily deactivate PS-Poll mode when there is mgmt or data message tx/rx and then, when message activity has ceased, to again activate PS-Poll mode. Precondition: MACInit must be called first. Parameters: action - Can be either: * WF_LOW_POWER_MODE_ON * WF_LOW_POWER_MODE_OFF Returns: None. Remarks: None. *****************************************************************************/ void WFConfigureLowPowerMode(uint8_t action) { uint16_t lowPowerStatusRegValue; /*-----------------------------------------*/ /* if activating PS-Poll mode on MRF24W */ /*-----------------------------------------*/ if (action == WF_LOW_POWER_MODE_ON) { SYS_CONSOLE_MESSAGE("EPS\r\n"); Write16BitWFRegister(WF_PSPOLL_H_REG, REG_ENABLE_LOW_POWER_MASK); g_psPollActive = true; } /*---------------------------------------------------------------------------------------------*/ /* else deactivating PS-Poll mode on MRF24W (taking it out of low-power mode and waking it up) */ /*---------------------------------------------------------------------------------------------*/ else /* action == WF_LOW_POWER_MODE_OFF */ { SYS_CONSOLE_MESSAGE("DPS\r\n"); Write16BitWFRegister(WF_PSPOLL_H_REG, REG_DISABLE_LOW_POWER_MASK); g_psPollActive = false; /* poll the response bit that indicates when the MRF24W has come out of low power mode */ do { /* set the index register to the register we wish to read */ Write16BitWFRegister(WF_INDEX_ADDR_REG, WF_LOW_POWER_STATUS_REG); lowPowerStatusRegValue = Read16BitWFRegister(WF_INDEX_DATA_REG); } while (lowPowerStatusRegValue & REG_ENABLE_LOW_POWER_MASK); } }
static void OutputScanType(void) { SYS_CONSOLE_MESSAGE("Scan Type: "); #if (WF_DEFAULT_SCAN_TYPE == WF_PASSIVE_SCAN) SYS_CONSOLE_MESSAGE("Passive Scan\r\n"); #else SYS_CONSOLE_MESSAGE("Active Scan\r\n"); #endif }
static void OutputPowerSaveMode(void) { SYS_CONSOLE_MESSAGE("Power Save: "); #if (WF_DEFAULT_PS_POLL == WF_ENABLED) SYS_CONSOLE_MESSAGE("Enabled\r\n"); #else SYS_CONSOLE_MESSAGE("Disabled\r\n"); #endif }
static void OutputNetworkType(void) { SYS_CONSOLE_MESSAGE("Network Type: "); #if (WF_DEFAULT_NETWORK_TYPE == WF_ADHOC) SYS_CONSOLE_MESSAGE("AdHoc"); #elif (WF_DEFAULT_NETWORK_TYPE == WF_INFRASTRUCTURE) SYS_CONSOLE_MESSAGE("Infrastructure"); #endif SYS_CONSOLE_MESSAGE("\r\n"); }
static void OutputConnectionPermLostMsg(uint16_t eventInfo) { char buf[8]; SYS_CONSOLE_MESSAGE("Event: Connection Permanently Lost -- eventInfo = "); sprintf(buf, "%d, ", eventInfo); SYS_CONSOLE_MESSAGE(buf); SYS_CONSOLE_MESSAGE(connectionLostStrings[eventInfo]); SYS_CONSOLE_MESSAGE("\r\n"); }
void WFDisplayScanMgr(void) { DRV_WIFI_SCAN_RESULT bssDesc; char ssid[32+1]; char buf[10]; int i; char rssiChan[48]; if ((SCANCXT.numScanResults == 0) || (!IS_SCAN_STATE_DISPLAY(SCANCXT.scanState)) || (IS_SCAN_IN_PROGRESS(SCANCXT.scanState)) || (!IS_SCAN_STATE_VALID(SCANCXT.scanState))) { SCAN_CLEAR_DISPLAY(SCANCXT.scanState); return; } WFRetrieveScanResult(SCANCXT.displayIdx, &bssDesc); /* Display SSID */ for(i=0;i<32;i++) ssid[i] = bssDesc.ssid[i]; ssid[32] = 0; if(bssDesc.ssidLen<32) ssid[bssDesc.ssidLen] = 0; sprintf(buf,"%d ",SCANCXT.displayIdx+1); SYS_CONSOLE_MESSAGE(buf); SYS_CONSOLE_MESSAGE("SSID:"); SYS_CONSOLE_MESSAGE(ssid); SYS_CONSOLE_MESSAGE("\r\n"); /* Display SSID & Channel */ /* RSSI_MAX : 200, RSSI_MIN : 106 */ sprintf(rssiChan, " => RSSI: %u, Channel: %u\r\n", bssDesc.rssi, bssDesc.channel); SYS_CONSOLE_MESSAGE(rssiChan); #if (WF_DEFAULT_NETWORK_TYPE == DRV_WIFI_NETWORK_TYPE_SOFT_AP) || (DRV_WIFI_DEFAULT_ADHOC_PRESCAN == DRV_WIFI_ENABLED) preScanResult[SCANCXT.displayIdx]= bssDesc; // WF_PRESCAN if (SCANCXT.displayIdx == sizeof(preScanResult) / sizeof(preScanResult[0]) - 1) { SCAN_CLEAR_DISPLAY(SCANCXT.scanState); SCANCXT.displayIdx = 0; #if defined(CMD_PARSER) WFConsoleReleaseConsoleMsg(); #endif } #endif if (++SCANCXT.displayIdx == SCANCXT.numScanResults) { SCAN_CLEAR_DISPLAY(SCANCXT.scanState); SCANCXT.displayIdx = 0; #if defined(CMD_PARSER) WFConsoleReleaseConsoleMsg(); #endif } }
static void OutputCommandPrompt(void) { if ( IS_ECHO_ON() ) { SYS_CONSOLE_MESSAGE("\n\r"); SYS_CONSOLE_MESSAGE(gCmdLinePrompt); } SET_CURSOR(gCmdLinePromptLength); memset(g_ConsoleContext.rxBuf, 0x00, sizeof(g_ConsoleContext.rxBuf)); }
void APP_Tasks( void ) { static SYS_TICK startTick = 0; static IPV4_ADDR dwLastIP[2] = { {-1}, {-1} }; IPV4_ADDR ipAddr; int i; switch(appData.state) { case APP_MOUNT_DISK: if(SYS_FS_Mount(SYS_FS_NVM_VOL, LOCAL_WEBSITE_PATH_FS, MPFS2, 0, NULL) == 0) { SYS_CONSOLE_PRINT("SYS_Initialize: The %s File System is mounted.\r\n", SYS_FS_MPFS_STRING); appData.state = APP_TCPIP_TRANSACT; } else { //SYS_CONSOLE_Print("SYS_Initialize: Failed to mount the %s File System! \r\n", SYS_FS_MPFS_STRING); appData.state = APP_MOUNT_DISK; } break; case APP_TCPIP_TRANSACT: if (SYS_TICK_Get() - startTick >= SYS_TICK_TicksPerSecondGet() / 2ul) { startTick = SYS_TICK_Get(); LEDstate ^= APP_USERIO_LED_ASSERTED; SYS_USERIO_SetLED(SYS_USERIO_LED_0, LEDstate); } // if the IP address of an interface has changed // display the new value on the system console nNets = TCPIP_STACK_NumberOfNetworksGet(); for (i = 0; i < nNets; i++) { netH = TCPIP_STACK_IndexToNet(i); ipAddr.Val = TCPIP_STACK_NetAddress(netH); if(dwLastIP[i].Val != ipAddr.Val) { dwLastIP[i].Val = ipAddr.Val; SYS_CONSOLE_MESSAGE(TCPIP_STACK_NetNameGet(netH)); SYS_CONSOLE_MESSAGE(" IP Address: "); SYS_CONSOLE_PRINT("%d.%d.%d.%d \r\n", ipAddr.v[0], ipAddr.v[1], ipAddr.v[2], ipAddr.v[3]); } } break; default: break; } }
static void OutputDeviceInfo(void) { char buf[20]; tWFDeviceInfo deviceInfo; SYS_CONSOLE_MESSAGE("Device: "); WF_GetDeviceInfo(&deviceInfo); sprintf(buf, "MRF24WB (0x%02X%02X)\r\n", deviceInfo.romVersion, deviceInfo.patchVersion); SYS_CONSOLE_MESSAGE(buf); }
static void OutputConnectionFailedMsg(uint16_t eventInfo) { char buf[8]; SYS_CONSOLE_MESSAGE("Event: Connection Failed -- eventInfo = "); sprintf(buf, "%d, ", eventInfo); SYS_CONSOLE_MESSAGE(buf); SYS_CONSOLE_MESSAGE(connectionFailureStrings[eventInfo]); SYS_CONSOLE_MESSAGE("\r\n"); }
static void OutputBeaconTimeout(void) { char buf[16]; SYS_CONSOLE_MESSAGE("Beacon Timeout: "); #if (WF_DEFAULT_BEACON_TIMEOUT == 0) SYS_CONSOLE_MESSAGE("Ignored\r\n"); #else sprintf(buf, "%d\r\n", WF_DEFAULT_BEACON_TIMEOUT); SYS_CONSOLE_MESSAGE(buf); #endif }
void APP_NVM_Info(void) { const uint8_t *addr1, *addr2, *addr3; char buf_t[30]; addr1 = &NVM_DATA_FLASH_RESERVE[0]; addr2 = &NVM_DATA_FLASH_RESERVE[DRV_NVM_PAGE_SIZE*2 - 1]; addr3 = (uint8_t*)NVM_WF_CONFIG__ADDRESS; SYS_CONSOLE_MESSAGE("\r\nadd is: "); sprintf(buf_t,"addr1 = 0x%x\r\n",addr1); SYS_CONSOLE_MESSAGE(buf_t); sprintf(buf_t,"addr2 = 0x%x\r\n",addr2); SYS_CONSOLE_MESSAGE(buf_t); sprintf(buf_t,"addr3 = 0x%x\r\n",addr3); SYS_CONSOLE_MESSAGE(buf_t); }
static void OutputRetryCount(void) { #if WF_DEFAULT_LIST_RETRY_COUNT != WF_RETRY_FOREVER char buf[16]; #endif SYS_CONSOLE_MESSAGE("Retry Count: "); #if (WF_DEFAULT_LIST_RETRY_COUNT == WF_RETRY_FOREVER) SYS_CONSOLE_MESSAGE("Retry Forever\r\n"); #else sprintf(buf, "%d\r\n", WF_DEFAULT_LIST_RETRY_COUNT); SYS_CONSOLE_MESSAGE(buf); #endif }
/***************************************************************************** * FUNCTION: IperfConsoleProcessEpilogue * * RETURNS: None * * PARAMS: None * * NOTES: Check if there is a left console msg, and release it if found. * *****************************************************************************/ void IperfConsoleProcessEpilogue(void) { if (IperfConsoleIsConsoleMsgReceived()) { if ( memcmp(ARGV[0], "help", 4) != 0 ) { SYS_CONSOLE_MESSAGE("Unknown cmd: "); SYS_CONSOLE_MESSAGE((char *)ARGV[0]); SYS_CONSOLE_MESSAGE("\r\n"); } IperfConsoleReleaseConsoleMsg(); } }
void APP_NVM_ReadALL(void) { uint32_t i; char buf_t[30]; uint8_t *p_data1; for(i=0x9d070000;i<0x9D080000;i++) { p_data1 = (void*)i; if(i%64 == 0) {sprintf(buf_t,"\r\n[%08x]:",i);SYS_CONSOLE_MESSAGE(buf_t);} sprintf(buf_t,"%02x ",*p_data1); SYS_CONSOLE_MESSAGE(buf_t); } }
static void do_help_msg(void) { uint8_t i; SYS_CONSOLE_MESSAGE("\n\r"); for (i = 0; i < g_numCmds; ++i) { SYS_CONSOLE_MESSAGE( (const FAR char *) g_consoleCmd[i].p_cmdName); SYS_CONSOLE_MESSAGE("\r\t\t"); SYS_CONSOLE_MESSAGE( (const FAR char*) g_consoleCmd[i].p_cmdHelp); SYS_CONSOLE_MESSAGE("\n\r"); } }
void APP_NVM_READ(uint32_t flag) { int i; uint8_t buf_t[30]; uint32_t Source_Addr; switch(flag) { case 0: Source_Addr = NVM_WF_CONFIG__ADDRESS - DRV_NVM_PAGE_SIZE; break; case 1: Source_Addr = NVM_WF_CONFIG__ADDRESS ; break; case 2: Source_Addr = NVM_WF_CONFIG__ADDRESS + DRV_NVM_PAGE_SIZE; break; case 3: Source_Addr = NVM_WF_CONFIG__ADDRESS + 2*DRV_NVM_PAGE_SIZE; break; case 4: Source_Addr = NVM_WF_CONFIG__ADDRESS + 3*DRV_NVM_PAGE_SIZE; break; case 5: Source_Addr = NVM_WF_CONFIG__ADDRESS + 4*DRV_NVM_PAGE_SIZE; break; default: Source_Addr = NVM_WF_CONFIG__ADDRESS; break; } if(wifi_nvm_handle.nvmHandle == 0) { wifi_nvm_handle.nvmHandle = DRV_NVM_Open(0, DRV_IO_INTENT_READWRITE); if(DRV_HANDLE_INVALID == wifi_nvm_handle.nvmHandle){ SYS_ASSERT(DRV_HANDLE_INVALID != wifi_nvm_handle.nvmHandle,"Error Opening Driver");} } wifi_nvm_handle.nvmbufferHandle = DRV_NVM_Read(wifi_nvm_handle.nvmHandle, NVM_DATA_TEST_BUFF, (uint8_t*)Source_Addr, DRV_NVM_PAGE_SIZE); if(DRV_NVM_BUFFER_HANDLE_INVALID == wifi_nvm_handle.nvmbufferHandle){ SYS_ASSERT(false, "Driver Read Failed");} while(DRV_NVM_BUFFER_COMPLETED != DRV_NVM_BufferStatus(wifi_nvm_handle.nvmHandle, wifi_nvm_handle.nvmbufferHandle)){;} SYS_CONSOLE_MESSAGE("\r\n---------"); for(i=0;i<DRV_NVM_PAGE_SIZE;i++) { if(i%64 == 0) {sprintf(buf_t,"\r\n[%08x]:",i+Source_Addr);SYS_CONSOLE_MESSAGE(buf_t);} sprintf(buf_t,"%02x ",NVM_DATA_TEST_BUFF[i]); SYS_CONSOLE_MESSAGE(buf_t); } SYS_CONSOLE_MESSAGE("\r\n---------"); }
/***************************************************************************** Function: static void OutputMacAddress(void) Summary: Outputs WiFi MAC address Description: Called by OuputDomain() Precondition: None Parameters: None Returns: None Remarks: None ***************************************************************************/ static void OutputMacAddress(void) { uint8_t mac[6]; int i; char buf[16]; WF_GetMacAddress(mac); SYS_CONSOLE_MESSAGE("MAC: "); for (i = 0; i < 6; ++i) { sprintf(buf, "%02X ", mac[i]); SYS_CONSOLE_MESSAGE(buf); } SYS_CONSOLE_MESSAGE("\r\n"); }
int8_t _APP_PumpDNS(const char * hostname, IPV4_ADDR *ipv4Addr) { DNS_RESULT result = TCPIP_DNS_IsResolved(hostname, ipv4Addr); switch (result) { case DNS_RES_OK: { // We now have an IPv4 Address TCPIP_DNS_UsageEnd(0); // Open a socket return 1; } case DNS_RES_PENDING: return 0; case DNS_RES_SERVER_TMO: case DNS_RES_NO_ENTRY: default: SYS_CONSOLE_MESSAGE("TCPIP_DNS_IsResolved returned failure\r\n"); TCPIP_DNS_UsageEnd(0); return -1; } // Should not be here! return -1; }
/***************************************************************************** * FUNCTION: RawSetByte * * RETURNS: None * * PARAMS: * rawId - RAW ID * pBuffer - Buffer containing bytes to write * length - number of bytes to read * * NOTES: Writes bytes to RAW window *****************************************************************************/ void RawSetByte(uint16_t rawId, uint8_t *pBuffer, uint16_t length) { uint8_t regId; #if defined(OUTPUT_RAW_TX_RX) uint16_t i; #endif /* if previously set index past legal range and now trying to write to RAW engine */ if ( (rawId == 0) && g_rxIndexSetBeyondBuffer && (GetRawWindowState(RAW_TX_ID) == WF_RAW_DATA_MOUNTED) ) { SYS_ASSERT(false, ""); /* attempting to write past end of RAW window */ } /* write RAW data to chip */ regId = (rawId==RAW_ID_0)?RAW_0_DATA_REG:RAW_1_DATA_REG; WriteWFArray(regId, pBuffer, length); #if defined(OUTPUT_RAW_TX_RX) for (i = 0; i < length; ++i) { char buf[16]; sprintf(buf,"T: %#x\r\n", pBuffer[i]); SYS_CONSOLE_MESSAGE(buf); } #endif }
/***************************************************************************** * FUNCTION: RawGetByte * * RETURNS: error code * * PARAMS: * rawId - RAW ID * pBuffer - Buffer to read bytes into * length - number of bytes to read * * NOTES: Reads bytes from the RAW engine *****************************************************************************/ void RawGetByte(uint16_t rawId, uint8_t *pBuffer, uint16_t length) { uint8_t regId; #if defined(OUTPUT_RAW_TX_RX) uint16_t i; #endif /* if reading a data message do following check */ if (!g_WaitingForMgmtResponse) { // if RAW index previously set out of range and caller is trying to do illegal read if ( (rawId==RAW_RX_ID) && g_rxIndexSetBeyondBuffer && (GetRawWindowState(RAW_RX_ID) == WF_RAW_DATA_MOUNTED) ) { SYS_ASSERT(false, ""); /* attempting to read past end of RAW buffer */ } } regId = (rawId==RAW_ID_0)?RAW_0_DATA_REG:RAW_1_DATA_REG; ReadWFArray(regId, pBuffer, length); #if defined(OUTPUT_RAW_TX_RX) for (i = 0; i < length; ++i) { char buf[16]; sprintf(buf,"R: %#x\r\n", pBuffer[i]); SYS_CONSOLE_MESSAGE(buf); } #endif }
static void EraseEntireLine() { // int i; SYS_CONSOLE_MESSAGE(eraseEntireLineEscapeSequence); CursorLeft_N(GET_CURSOR()); SET_CURSOR(0); }
void DisplayIPValue(IP_ADDR IPVal) { char message[16 + 1]; // printf("%u.%u.%u.%u", IPVal.v[0], IPVal.v[1], IPVal.v[2], IPVal.v[3]); #if defined (__dsPIC33E__) || defined (__PIC24E__) static uint8_t IPDigit[4]; /* Needs to be declared as static to avoid the array getting optimized by C30 v3.30 compiler for dsPIC33E/PIC24E. Otherwise the LCD displays corrupted IP address on Explorer 16. To be fixed in the future compiler release*/ #else uint8_t IPDigit[4]; #endif uint8_t i; strcpy(message, ""); for (i = 0; i < sizeof (IP_ADDR); i++) { uitoa((uint16_t) IPVal.v[i], IPDigit); strcat(message, (char *) IPDigit); if (i < sizeof (IP_ADDR) - 1) { strcat(message, "."); } } SYS_OUT_MESSAGE_LINE(message, 1); SYS_CONSOLE_MESSAGE((char *) message); }
/*= CursorRight_N ============================================================== Purpose: Moves the cursor left N characters to the right Inputs: n -- number of characters to move the cursor to the left Note: This sequence only takes a single digit of length, so may need to do the move in steps Returns: none ============================================================================*/ void CursorRight_N(uint8_t n) { char sequence_string[sizeof(cursorRightEscapeSequence) + 2]; /* null and extra digit */ // ASSERT(n <= (strlen(g_ConsoleContext.buf) + CMD_LINE_PROMPT_LENGTH)); if (n > 0u) { SET_CURSOR( GET_CURSOR() + n ); sequence_string[0] = cursorRightEscapeSequence[0]; /* ESC */ sequence_string[1] = cursorRightEscapeSequence[1]; /* '[' */ if (n < 10u) { sequence_string[2] = n + '0'; /* ascii digit */ sequence_string[3] = cursorRightEscapeSequence[3]; /* 'C' */ sequence_string[4] = '\0'; } else { sequence_string[2] = (n / 10) + '0'; /* first ascii digit */ sequence_string[3] = (n % 10) + '0'; /* second ascii digit */ sequence_string[4] = cursorRightEscapeSequence[3]; /* 'C' */ sequence_string[5] = '\0'; } SYS_CONSOLE_MESSAGE(sequence_string); } }
static void OutputSsid(void) { NET_CONFIG* p_config; p_config = GetNetworkConfig(); SYS_CONSOLE_MESSAGE("SSID: "); if (p_config->MySSID[0] == '\0') { SYS_CONSOLE_MESSAGE("(none)"); } else { SYS_CONSOLE_MESSAGE((char *)p_config->MySSID); } SYS_CONSOLE_MESSAGE("\r\n"); }
void APP_NVM_Write2(void) { int i; uint8_t buf_t[10]; char c_tmp = 0; for(i = 0;i<DRV_NVM_PAGE_SIZE;i++) { NVM_DATA_TEST_BUFF[i] = 0x55; } SYS_CONSOLE_MESSAGE("2. erase\r\n"); NVMErasePage((void*)NVM_WF_CONFIG__ADDRESS); SYS_CONSOLE_MESSAGE("3. Write\r\n"); NVMWriteRow((void*)NVM_WF_CONFIG__ADDRESS, (void*)NVM_DATA_TEST_BUFF); SYS_CONSOLE_MESSAGE("4. Done\r\n"); }
/*= CursorRight ============================================================= Purpose: Moves the cursor right by one character Inputs: none Returns: none ============================================================================*/ void CursorRight(void) { /* if cursor is not already at the right-most position */ if (GET_CURSOR() < GET_LEN_RX_CMD_STRING() + gCmdLinePromptLength) { SET_CURSOR( GET_CURSOR() + 1); SYS_CONSOLE_MESSAGE(cursorRightEscapeSequence); } }