Skip to content

Commit

Permalink
cool dhcp work
Browse files Browse the repository at this point in the history
  • Loading branch information
karasevia committed Jul 25, 2023
1 parent 6e8ba51 commit 73b16f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 4 additions & 0 deletions eth_view_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ static uint16_t get_string_with_width(const char* str, uint16_t width) {
char copy[SCREEN_SYMBOLS_WIDTH + 1] = {0};

for(;;) {
if(str[end] == '\n') {
break;
}
if(str[end] == '\0') {
break;
}
Expand Down Expand Up @@ -410,6 +413,7 @@ void ethernet_view_process_print(EthViewProcess* process, const char* str) {
uint16_t len = strlen(str);

while(ptr < len) {
if(str[ptr] == '\n') ptr += 1;
uint16_t start = ptr;
ptr += get_string_with_width(str + ptr, max_width);
uint8_t carriage = process->carriage;
Expand Down
17 changes: 6 additions & 11 deletions eth_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,42 +357,37 @@ int32_t eth_worker_task(void* context) {
eth_log(EthWorkerProcessDHCP, "DHCP Failed");
break;
}
furi_delay_ms(1);
next_cycle = 0;
next_cycle |= dhcp_ret == DHCP_IP_ASSIGN;
next_cycle |= dhcp_ret == DHCP_IP_CHANGED;
next_cycle |= dhcp_ret == DHCP_FAILED;
next_cycle |= dhcp_ret == DHCP_IP_LEASED;
next_cycle != next_cycle;
furi_delay_ms(1000);
next_cycle = (dhcp_ret == DHCP_RUNNING);
}
if(worker->state != EthWorkerStateDHCP) {
break;
}
//wizchip_getnetinfo(&gWIZNETINFO);
eth_log(
EthWorkerProcessDHCP,
"IP address : %d.%d.%d.%d",
"IP address:\n %d.%d.%d.%d",
gWIZNETINFO.ip[0],
gWIZNETINFO.ip[1],
gWIZNETINFO.ip[2],
gWIZNETINFO.ip[3]);
eth_log(
EthWorkerProcessDHCP,
"SM Mask : %d.%d.%d.%d",
"SM Mask:\n %d.%d.%d.%d",
gWIZNETINFO.sn[0],
gWIZNETINFO.sn[1],
gWIZNETINFO.sn[2],
gWIZNETINFO.sn[3]);
eth_log(
EthWorkerProcessDHCP,
"Gate way : %d.%d.%d.%d",
"Gate way:\n %d.%d.%d.%d",
gWIZNETINFO.gw[0],
gWIZNETINFO.gw[1],
gWIZNETINFO.gw[2],
gWIZNETINFO.gw[3]);
eth_log(
EthWorkerProcessDHCP,
"DNS Server : %d.%d.%d.%d",
"DNS Server:\n %d.%d.%d.%d",
gWIZNETINFO.dns[0],
gWIZNETINFO.dns[1],
gWIZNETINFO.dns[2],
Expand Down

0 comments on commit 73b16f9

Please sign in to comment.