New quickconfigs for Nedis WIFIP130FWT and WIFIPO120FWT devices

This commit is contained in:
Timo Viinanen
2022-02-15 10:17:30 +02:00
parent 3cb88a8560
commit 29088ab658
2 changed files with 72 additions and 16 deletions

View File

@ -305,7 +305,10 @@ template_t g_templates [] = {
{ Setup_Device_TuyaLEDDimmerSingleChannel, "Tuya LED Dimmer Single Channel PWM WB3S"},
{ Setup_Device_CalexLEDDimmerFiveChannel, "Calex RGBWW LED Dimmer Five Channel PWM BK7231S"},
{ Setup_Device_CalexPowerStrip_900018_1v1_0UK, "Calex UK power strip 900018.1 v1.0 UK"},
{ Setup_Device_ArlecCCTDownlight, "Arlec CCT LED Downlight ALD029CHA"}
{ Setup_Device_ArlecCCTDownlight, "Arlec CCT LED Downlight ALD029CHA"},
{ Setup_Device_NedisWIFIPO120FWT_16A, "Nedis WIFIPO120FWT 16A"},
{ Setup_Device_NedisWIFIP130FWT_10A, "Nedis WIFIP130FWT 10A"}
};
int g_total_templates = sizeof(g_templates)/sizeof(g_templates[0]);
@ -417,16 +420,16 @@ int hprintf128(http_request_t *request, const char *fmt, ...){
return postany(request, tmp, strlen(tmp));
}
uint8_t hexdigit( char hex )
{
return (hex <= '9') ? hex - '0' :
toupper(hex) - 'A' + 10 ;
}
uint8_t hexbyte( const char* hex )
{
return (hexdigit(*hex) << 4) | hexdigit(*(hex+1)) ;
}
uint8_t hexdigit( char hex )
{
return (hex <= '9') ? hex - '0' :
toupper(hex) - 'A' + 10 ;
}
uint8_t hexbyte( const char* hex )
{
return (hexdigit(*hex) << 4) | hexdigit(*(hex+1)) ;
}
int HTTP_ProcessPacket(http_request_t *request) {
int i, j;
@ -772,10 +775,10 @@ int HTTP_ProcessPacket(http_request_t *request) {
poststr(request,htmlHeader);
poststr(request,g_header);
if(http_getArg(recvbuf,"mac",tmpA,sizeof(tmpA))) {
for( i = 0; i < 6; i++ )
{
mac[i] = hexbyte( &tmpA[i * 2] ) ;
if(http_getArg(recvbuf,"mac",tmpA,sizeof(tmpA))) {
for( i = 0; i < 6; i++ )
{
mac[i] = hexbyte( &tmpA[i * 2] ) ;
}
WiFI_SetMacAddress((char*)mac);
//sscanf(tmpA,"%02X%02X%02X%02X%02X%02X",&mac[0],&mac[1],&mac[2],&mac[3],&mac[4],&mac[5]);
@ -832,7 +835,7 @@ int HTTP_ProcessPacket(http_request_t *request) {
now = rem;
}
#if PLATFORM_XR809
//uint32_t flash_read(uint32_t flash, uint32_t addr,void *buf, uint32_t size)
//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);
#else