VirtualBox

source: vbox/trunk/src/VBox/Additions/3D/mesa/mesa-24.0.2/.gitlab-ci/bare-metal/eth008-power-relay.py@ 103996

Last change on this file since 103996 was 103996, checked in by vboxsync, 13 months ago

Additions/3D/mesa: export mesa-24.0.2 to OSE. bugref:10606

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 407 bytes
Line 
1#!/usr/bin/python3
2
3import sys
4import socket
5
6host = sys.argv[1]
7port = sys.argv[2]
8mode = sys.argv[3]
9relay = sys.argv[4]
10msg = None
11
12if mode == "on":
13 msg = b'\x20'
14else:
15 msg = b'\x21'
16
17msg += int(relay).to_bytes(1, 'big')
18msg += b'\x00'
19
20c = socket.create_connection((host, int(port)))
21c.sendall(msg)
22
23data = c.recv(1)
24c.close()
25
26if data[0] == b'\x01':
27 print('Command failed')
28 sys.exit(1)
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette