Skip to content

Commit e82e4fb

Browse files
authored
Rename lib/device/fuji.h to lib/device/fujiDevice.h (#1055)
1 parent 85b38bb commit e82e4fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+257
-1869
lines changed

fujinet_pc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ set(SOURCES src/main.cpp
246246
lib/device/printer.h
247247
lib/device/modem.h
248248
lib/device/cassette.h
249-
lib/device/fuji.h
249+
lib/device/fujiDevice.h
250250
lib/device/network.h
251251
lib/device/udpstream.h
252252
lib/device/siocpm.h

lib/bus/adamnet/adamnet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "fnSystem.h"
1111
#include "led.h"
1212
#include <cstring>
13-
#include "fuji.h"
13+
#include "adamFuji.h"
1414

1515
#define IDLE_TIME 180 // Idle tolerance in microseconds
1616

lib/bus/drivewire/drivewire.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "../../include/debug.h"
88

9-
#include "fuji.h"
9+
#include "fujiDevice.h"
1010
#include "udpstream.h"
1111
#include "modem.h"
1212
#include "cassette.h"

lib/bus/iec/iec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifdef BUILD_IEC
22

33
#include "iec.h"
4-
#include "fuji.h"
4+
#include "fujiDevice.h"
55

66
#include <cstring>
77
#include <memory>

lib/bus/mac/mac.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#ifdef BUILD_MAC
22
#include "mac.h"
3-
#include "../../include/debug.h"
4-
#include "../device/mac/macFuji.h"
5-
63
#include "mac_ll.h"
4+
#include "macFuji.h"
75

6+
#include "../../include/debug.h"
87

98
void systemBus::setup(void)
109
{

lib/bus/rs232/rs232.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "../../include/debug.h"
66

7-
#include "fuji.h"
7+
#include "fujiDevice.h"
88
#include "udpstream.h"
99
#include "modem.h"
1010
#include "siocpm.h"

lib/bus/sio/sio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "../../include/debug.h"
66

7-
#include "fuji.h"
7+
#include "fujiDevice.h"
88
#include "udpstream.h"
99
#include "modem.h"
1010
#include "siocpm.h"

lib/console/Commands/NetworkCommands.cpp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <esp_wifi.h>
1111
#include <esp_crc.h>
1212

13-
#include "../device/fuji.h"
13+
#include "fujiDevice.h"
1414
#include "fnWiFi.h"
1515

1616
#include "string_utils.h"
@@ -86,24 +86,24 @@ static void on_ping_timeout(esp_ping_handle_t hdl, void *args)
8686
static void on_ping_end(esp_ping_handle_t hdl, void *args)
8787
{
8888
ip_addr_t target_addr;
89-
uint32_t transmitted;
90-
uint32_t received;
91-
uint32_t total_time_ms;
92-
esp_ping_get_profile(hdl, ESP_PING_PROF_REQUEST, &transmitted, sizeof(transmitted));
93-
esp_ping_get_profile(hdl, ESP_PING_PROF_REPLY, &received, sizeof(received));
94-
esp_ping_get_profile(hdl, ESP_PING_PROF_IPADDR, &target_addr, sizeof(target_addr));
95-
esp_ping_get_profile(hdl, ESP_PING_PROF_DURATION, &total_time_ms, sizeof(total_time_ms));
96-
uint32_t loss = (uint32_t)((1 - ((float)received) / transmitted) * 100);
97-
if (IP_IS_V4(&target_addr)) {
98-
printf("\n--- %s ping statistics ---", inet_ntoa(*ip_2_ip4(&target_addr)));
99-
} else {
100-
printf("\n--- %s ping statistics ---", inet6_ntoa(*ip_2_ip6(&target_addr)));
101-
}
102-
printf("%" PRIu32 " packets transmitted, %" PRIu32 " received, %" PRIu32 "%% packet loss, time %" PRIu32 "ms",
103-
transmitted, received, loss, total_time_ms);
104-
// delete the ping sessions, so that we clean up all resources and can create a new ping session
105-
// we don't have to call delete function in the callback, instead we can call delete function from other tasks
106-
esp_ping_delete_session(hdl);
89+
uint32_t transmitted;
90+
uint32_t received;
91+
uint32_t total_time_ms;
92+
esp_ping_get_profile(hdl, ESP_PING_PROF_REQUEST, &transmitted, sizeof(transmitted));
93+
esp_ping_get_profile(hdl, ESP_PING_PROF_REPLY, &received, sizeof(received));
94+
esp_ping_get_profile(hdl, ESP_PING_PROF_IPADDR, &target_addr, sizeof(target_addr));
95+
esp_ping_get_profile(hdl, ESP_PING_PROF_DURATION, &total_time_ms, sizeof(total_time_ms));
96+
uint32_t loss = (uint32_t)((1 - ((float)received) / transmitted) * 100);
97+
if (IP_IS_V4(&target_addr)) {
98+
printf("\n--- %s ping statistics ---", inet_ntoa(*ip_2_ip4(&target_addr)));
99+
} else {
100+
printf("\n--- %s ping statistics ---", inet6_ntoa(*ip_2_ip6(&target_addr)));
101+
}
102+
printf("%" PRIu32 " packets transmitted, %" PRIu32 " received, %" PRIu32 "%% packet loss, time %" PRIu32 "ms",
103+
transmitted, received, loss, total_time_ms);
104+
// delete the ping sessions, so that we clean up all resources and can create a new ping session
105+
// we don't have to call delete function in the callback, instead we can call delete function from other tasks
106+
esp_ping_delete_session(hdl);
107107
}
108108

109109
static int ping(int argc, char **argv)
@@ -178,10 +178,10 @@ static int ping(int argc, char **argv)
178178
esp_ping_start(ping);
179179

180180
char c = 0;
181-
181+
182182
uint16_t seqno;
183183
esp_ping_get_profile(ping, ESP_PING_PROF_SEQNO, &seqno, sizeof(seqno));
184-
184+
185185
//Make stdin input non blocking so we can query for input AND check ping seqno
186186
int flags = fcntl(fileno(stdin), F_GETFL, 0);
187187
fcntl(fileno(stdin), F_SETFL, flags | O_NONBLOCK);
@@ -224,7 +224,7 @@ static void ipconfig_wlan()
224224
// if (status == WL_NO_SHIELD) {
225225
// return;
226226
// }
227-
227+
228228
// printf("\r\n");
229229
// printf("SSID: %s\r\n", fnWiFi.get_current_ssid().c_str());
230230
// printf("BSSID: %s\r\n", fnWiFi.get_current_bssid_str().c_str());
@@ -235,7 +235,7 @@ static void ipconfig_wlan()
235235
// printf("Subnet Mask: %s (/%d)\r\n", WiFi.subnetMask().toString().c_str(), WiFi.subnetCIDR());
236236
// printf("Gateway: %s\r\n", WiFi.gatewayIP().toString().c_str());
237237
// printf("IPv6: %s\r\n", WiFi.localIPv6().toString().c_str());
238-
238+
239239
// printf("\r\n");
240240
// printf("Hostname: %s\r\n", WiFi.getHostname());
241241
// printf("DNS1: %s\r\n", WiFi.dnsIP(0).toString().c_str());
@@ -293,16 +293,16 @@ std::vector<std::string> getLocalUrl() {
293293
};
294294
}
295295

296-
void serial_write(std::vector<uint8_t> &data) {
296+
void serial_write(std::vector<uint8_t> &data) {
297297
// print buffer bytes
298298
for (int i = 0; i < data.size(); i++) {
299299
fprintf(stdout, "%c", data[i]);
300300
}
301301
}
302302

303303

304-
void set_state(improv::State state) {
305-
304+
void set_state(improv::State state) {
305+
306306
std::vector<uint8_t> data = {'I', 'M', 'P', 'R', 'O', 'V'};
307307
data.resize(11);
308308
data[6] = improv::IMPROV_SERIAL_VERSION;
@@ -354,7 +354,7 @@ void set_error(improv::Error error) {
354354
void getAvailableWifiNetworks() {
355355
// int networkNum = WiFi.scanNetworks();
356356

357-
// for (int id = 0; id < networkNum; ++id) {
357+
// for (int id = 0; id < networkNum; ++id) {
358358
// std::vector<uint8_t> data = improv::build_rpc_response(
359359
// improv::GET_WIFI_NETWORKS, {WiFi.SSID(id), String(WiFi.RSSI(id)), (WiFi.encryptionType(id) == WIFI_AUTH_OPEN ? "NO" : "YES")}, false);
360360
// send_response(data);
@@ -432,7 +432,7 @@ static int improv_c(int argc, char **argv)
432432
} else {
433433
set_state(improv::State::STATE_AUTHORIZED);
434434
}
435-
435+
436436
break;
437437
}
438438

@@ -442,23 +442,23 @@ static int improv_c(int argc, char **argv)
442442
set_error(improv::Error::ERROR_INVALID_RPC);
443443
break;
444444
}
445-
445+
446446
set_state(improv::STATE_PROVISIONING);
447-
447+
448448
if (connectWifi(cmd.ssid, cmd.password)) {
449449

450450
//blink_led(100, 3);
451-
451+
452452
//TODO: Persist credentials here
453453

454-
set_state(improv::STATE_PROVISIONED);
454+
set_state(improv::STATE_PROVISIONED);
455455
std::vector<uint8_t> data = improv::build_rpc_response(improv::WIFI_SETTINGS, getLocalUrl(), false);
456456
send_response(data);
457457
} else {
458458
set_state(improv::STATE_STOPPED);
459459
set_error(improv::Error::ERROR_UNABLE_TO_CONNECT);
460460
}
461-
461+
462462
break;
463463
}
464464

@@ -520,4 +520,4 @@ namespace ESP32Console::Commands
520520
{
521521
return ConsoleCommand("improv", &improv_c, "Wifi config via IMPROV protocol");
522522
}
523-
}
523+
}

lib/console/Commands/VFSCommands.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "../Helpers/PWDHelpers.h"
1414
#include "../ute/ute.h"
1515

16-
#include "../device/fuji.h"
16+
#include "fujiDevice.h"
1717
#include "display.h"
1818
#include "meatloaf.h"
1919
#include "string_utils.h"
@@ -487,4 +487,4 @@ namespace ESP32Console::Commands
487487
{
488488
return ConsoleCommand("wget", &wget, "Download url to file");
489489
}
490-
}
490+
}

lib/device/adamnet/adamFuji.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifdef BUILD_ADAM
22

3-
#include "fuji.h"
3+
#include "adamFuji.h"
44
#include "fujiCommandID.h"
55

66
#include <cstring>

0 commit comments

Comments
 (0)