mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-03-06 15:37:10 +00:00
bl602 port p1
This commit is contained in:
@ -13,6 +13,8 @@
|
||||
|
||||
#ifdef WINDOWS
|
||||
// nothing
|
||||
#elif PLATFORM_BL602
|
||||
|
||||
#elif PLATFORM_XR809
|
||||
#include <image/flash.h>
|
||||
#elif defined(PLATFORM_BK7231N)
|
||||
@ -396,6 +398,8 @@ int http_fn_cfg_wifi(http_request_t *request) {
|
||||
#elif PLATFORM_XR809
|
||||
poststr(request,"TODO XR809<br>");
|
||||
|
||||
#elif PLATFORM_BL602
|
||||
poststr(request,"TODO BL602<br>");
|
||||
#elif PLATFORM_BK7231T
|
||||
AP_IF_S *ar;
|
||||
uint32_t num;
|
||||
@ -624,6 +628,8 @@ int http_fn_flash_read_tool(http_request_t *request) {
|
||||
//uint32_t flash_read(uint32_t flash, uint32_t addr,void *buf, uint32_t size)
|
||||
#define FLASH_INDEX_XR809 0
|
||||
res = flash_read(FLASH_INDEX_XR809, nowOfs, buffer, now);
|
||||
#elif PLATFORM_BL602
|
||||
|
||||
#else
|
||||
res = bekken_hal_flash_read (nowOfs, buffer,now);
|
||||
#endif
|
||||
@ -771,6 +777,8 @@ int http_fn_config_dump_table(http_request_t *request) {
|
||||
poststr(request,"Not implemented <br>");
|
||||
#elif PLATFORM_XR809
|
||||
poststr(request,"Not implemented <br>");
|
||||
#elif PLATFORM_BL602
|
||||
poststr(request,"Not implemented <br>");
|
||||
#else
|
||||
poststr(request,"Dumped to log <br>");
|
||||
config_dump_table();
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
#define close lwip_close
|
||||
|
||||
#elif PLATFORM_BL602
|
||||
|
||||
#else
|
||||
#include "str_pub.h"
|
||||
#endif
|
||||
@ -66,8 +68,12 @@ static void tcp_client_thread( beken_thread_arg_t arg )
|
||||
|
||||
reply = (char*) os_malloc( replyBufferSize );
|
||||
buf = (char*) os_malloc( 1026 );
|
||||
ASSERT(buf);
|
||||
|
||||
if ( buf == 0 || reply == 0)
|
||||
{
|
||||
ADDLOG_ERROR(LOG_FEATURE_HTTP, "TCP Client failed to malloc buffer" );
|
||||
goto exit;
|
||||
}
|
||||
http_request_t request;
|
||||
os_memset(&request, 0, sizeof(request));
|
||||
|
||||
|
||||
@ -10,6 +10,10 @@
|
||||
#elif PLATFORM_XR809
|
||||
#include "lwip/sockets.h"
|
||||
#include <stdarg.h>
|
||||
#elif PLATFORM_BL602
|
||||
#include "lwip/sockets.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#else
|
||||
#include "lwip/sockets.h"
|
||||
#include "str_pub.h"
|
||||
@ -283,6 +287,10 @@ const char *g_header = "<h1><a href=\"https://github.com/openshwprojects/OpenBK7
|
||||
|
||||
const char *g_header = "<h1><a href=\"https://github.com/openshwprojects/OpenBK7231T/\">OpenBK7231T</a></h1><h3><a href=\"https://www.elektroda.com/rtvforum/viewtopic.php?p=19841301#19841301\">[Read more]</a><a href=\"https://paypal.me/openshwprojects\">[Support project]</a></h3>";
|
||||
|
||||
#elif PLATFORM_BL602
|
||||
|
||||
const char *g_header = "<h1><a href=\"https://github.com/openshwprojects/OpenBK7231T/\">OpenBL602</a></h1><h3><a href=\"https://www.elektroda.com/rtvforum/viewtopic.php?p=19841301#19841301\">[Read more]</a><a href=\"https://paypal.me/openshwprojects\">[Support project]</a></h3>";
|
||||
|
||||
#elif WINDOWS
|
||||
|
||||
const char *g_header = "<h1><a href=\"https://github.com/openshwprojects/OpenBK7231T/\">OpenBK7231 [Win test]</a></h1><h3><a href=\"https://www.elektroda.com/rtvforum/viewtopic.php?p=19841301#19841301\">[Read more]</a><a href=\"https://paypal.me/openshwprojects\">[Support project]</a></h3>";
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
#include "lwip/sockets.h"
|
||||
#if PLATFORM_XR809
|
||||
#include <image/flash.h>
|
||||
#elif PLATFORM_BL602
|
||||
|
||||
#else
|
||||
#include "../flash_config/flash_config.h"
|
||||
#endif
|
||||
@ -26,6 +28,7 @@
|
||||
#if PLATFORM_XR809
|
||||
uint32_t flash_read(uint32_t flash, uint32_t addr,void *buf, uint32_t size);
|
||||
#define FLASH_INDEX_XR809 0
|
||||
#elif PLATFORM_BL602
|
||||
#else
|
||||
extern UINT32 flash_read(char *user_buf, UINT32 count, UINT32 address);
|
||||
#endif
|
||||
@ -92,6 +95,11 @@ const char *obktype = "XR809";
|
||||
const char * apppage2 = "';"
|
||||
" var obktype = 'XR809';"
|
||||
" var device = 'http://";
|
||||
#elif PLATFORM_BL602
|
||||
const char *obktype = "BL602";
|
||||
const char * apppage2 = "';"
|
||||
" var obktype = 'BL602';"
|
||||
" var device = 'http://";
|
||||
#else
|
||||
const char *obktype = "beken";
|
||||
const char * apppage2 = "';"
|
||||
@ -506,6 +514,7 @@ static int http_favicon(http_request_t *request){
|
||||
request->responseCode = HTTP_RESPONSE_NOT_FOUND;
|
||||
http_setup(request, httpMimeTypeHTML);
|
||||
poststr(request,NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -885,6 +894,8 @@ static int http_rest_get_flash(http_request_t *request, int startaddr, int len){
|
||||
//uint32_t flash_read(uint32_t flash, uint32_t addr,void *buf, uint32_t size)
|
||||
#define FLASH_INDEX_XR809 0
|
||||
res = flash_read(FLASH_INDEX_XR809, startaddr, buffer, readlen);
|
||||
#elif PLATFORM_BL602
|
||||
res = 0;
|
||||
#else
|
||||
res = flash_read((char *)buffer, readlen, startaddr);
|
||||
#endif
|
||||
@ -900,6 +911,8 @@ static int http_rest_get_flash(http_request_t *request, int startaddr, int len){
|
||||
static int http_rest_get_dumpconfig(http_request_t *request){
|
||||
|
||||
#if PLATFORM_XR809
|
||||
|
||||
#elif PLATFORM_BL602
|
||||
#else
|
||||
config_dump_table();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user