Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Merge branch 'update-from-upstream' of https://github.com/git-develop…
Browse files Browse the repository at this point in the history
…er/sc-controller into git-developer-update-from-upstream
  • Loading branch information
Ryochan7 committed Nov 7, 2023
2 parents 383129b + af62df4 commit 9fbb2a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
8 changes: 6 additions & 2 deletions scc/cemuhook_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,12 @@ bool sccd_cemuhook_socket_enable() {
memset(&server_addr, 0, sizeof(struct sockaddr_in));
server_addr.sin_family = AF_INET;
server_addr.sin_addr.s_addr = inet_addr("127.0.0.1");
server_addr.sin_port = htons(26760);

if (const char* custom_port = getenv("SCC_SERVER_PORT")) {
server_addr.sin_port = atoi(custom_port);
} else {
server_addr.sin_port = htons(26760);
}

#ifdef _WIN32
WSADATA wsaData;
int err = WSAStartup(MAKEWORD(2, 2), &wsaData);
Expand Down
5 changes: 3 additions & 2 deletions scc/cemuhook_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from scc.lib.enum import IntEnum
from ctypes import c_uint32, c_int, c_bool, c_char_p, c_size_t, c_float
from ctypes import create_string_buffer
import logging, socket
import logging, os, socket
from threading import Thread
from time import sleep
from datetime import datetime, timedelta
Expand Down Expand Up @@ -52,7 +52,8 @@ def __init__(self, daemon):
poller = daemon.get_poller()
daemon.poller.register(self.socket.fileno(), poller.POLLIN, self.on_data_recieved)

self.socket.bind(('127.0.0.1', 26760))
server_port = os.getenv('SCC_SERVER_PORT') or PORT;
self.socket.bind(('127.0.0.1', server_port))
log.info("Created CemuHookUDP Motion Provider")

Thread(target=self._keepalive).start()
Expand Down
9 changes: 7 additions & 2 deletions scc/device_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,13 @@ def _dev_for_hci(self, syspath):
node_addr = str.upper(node_addr)
except IOError:
continue
if node_addr == addr:
return node
try:
# SteamOS 3 "Holo" return caps
if node_addr.lower() == addr.lower():
return node
# None
except AttributeError:
pass
return None


Expand Down

0 comments on commit 9fbb2a1

Please sign in to comment.