mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
support for craftos-pc env by supporting modems instead of wireless modems for comms
This commit is contained in:
parent
2aedc015c8
commit
41cc6b9acc
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -11,6 +11,7 @@
|
||||
"shell",
|
||||
"settings",
|
||||
"window",
|
||||
"read"
|
||||
"read",
|
||||
"periphemu"
|
||||
]
|
||||
}
|
||||
|
@ -302,12 +302,15 @@ function ppm.get_fission_reactor()
|
||||
end
|
||||
|
||||
-- get the wireless modem (if multiple, returns the first)
|
||||
--
|
||||
-- if this is in a CraftOS emulated environment, wired modems will be used instead
|
||||
---@return table|nil modem function table
|
||||
function ppm.get_wireless_modem()
|
||||
local w_modem = nil
|
||||
local emulated_env = periphemu ~= nil
|
||||
|
||||
for _, device in pairs(_ppm_sys.mounts) do
|
||||
if device.type == "modem" and device.dev.isWireless() then
|
||||
if device.type == "modem" and (emulated_env or device.dev.isWireless()) then
|
||||
w_modem = device.dev
|
||||
break
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user