Skip to content

Commit

Permalink
update more source codes
Browse files Browse the repository at this point in the history
Signed-off-by: Douglas Schilling Landgraf <[email protected]>
  • Loading branch information
dougsland committed Sep 16, 2024
1 parent 3a70946 commit 506b579
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions src/joysticks/container_joysticks_service
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from gi.repository import GLib
from pydbus import SystemBus
from gi.repository import GLib
from evdev import InputDevice, list_devices, ecodes
Expand Down Expand Up @@ -71,6 +72,10 @@ class JoystickService:
self.JoystickSignalEmitted(signal_name, value)


def on_timeout():
print("Timeout occurred, performing periodic task")
return True

if __name__ == "__main__":
service = JoystickService()

Expand All @@ -84,11 +89,17 @@ if __name__ == "__main__":
print(f"Error registering D-Bus name: {e}")
exit(1)

#bus.publish(
# "com.vss_lib.JoystickSignals",
# service,
# replace=True
#)

# Start listening for joystick events
service.start_joystick_listening()

# Setup the main loop
loop = GLib.MainLoop()

# Add a timeout (in milliseconds). For example, 1000 ms = 1 second
GLib.timeout_add(1000, on_timeout)

try:
loop.run()
except KeyboardInterrupt:
logger.info("Service interrupted by user.")

2 changes: 1 addition & 1 deletion usr/share/vss-lib/joysticks/ContainerFile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG VSS_SPEC_PATH=/usr/share/vss-lib
ARG CONFIG_PATH=/etc/vss-lib/vss.config

# Install necessary system dependencies
RUN dnf install -y python3-gobject python3-pip hostname kernel-headers gcc python3-devel && \
RUN dnf install -y python3-gobject python3-pip hostname kernel-headers gcc python3-devel procps-ng && \
dnf clean all

# Install necessary Python packages
Expand Down

0 comments on commit 506b579

Please sign in to comment.