You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#command = USERINPUT IN CONSOLE
command = command2
#Write / Specialize Query Symbol with dynamic user input
abstractLayer1.writeSymbol(QUERY_SYMBOL)
(received_symbol, received_data) = abstractLayer1.readSymbol()
print(received_symbol.name)
`
The text was updated successfully, but these errors were encountered:
I almost give up, please help! How i can update Symbols with dynamic user-input and environment variables? I have e.g.
`# global variables
command1 = "ps aux"
command2 = "ls -l /proc/"
command3 = "cat " + consoleimput + "\n\n"
####################################################
CLIENT_HELLO_SYMBOL = Symbol(name="hello")
CLIENT_HELLO_SYMBOL.fields = [
Field(name="Message-Type", domain=HexaString(b"00112233")),
Field(name="SessionID", domain=HexaString(b"00000000")),
]
INPUT_VOCABULARY.append(CLIENT_HELLO_SYMBOL)
####################################################
SERVER_HELLO_SYMBOL = Symbol(name="hello")
SERVER_HELLO_SYMBOL.fields = [
Field(name="Message-Type", domain=HexaString(b"33221100")),
Field(name="SessionID", domain=HexaString(b"4FFFFF3E")),
]
OUTPUT_VOCABULARY.append(SERVER_HELLO_SYMBOL)
####################################################
QUERY_SYMBOL = Symbol(name="hello")
QUERY_SYMBOL.fields = [
Field(name="Message-Type", domain=HexaString(b"22221111")),
Field(Value(SERVER_HELLO_SYMBOL.fields[1]), #so we can access the sessionID
Field(name="command-with-args", ??? command3
]
INPUT_VOCABULARY.append(QUERY_SYMBOL)
####################################################
####################################################
open TCP Client
tcp_client = TCPClient(remoteIP='192.168.1.2', remotePort=9000)
abstractLayer1 = AbstractionLayer(tcp_client, INPUT_VOCABULARY + OUTPUT_VOCABULARY)
abstractLayer1.writeSymbol(CLIENT_HELLO_SYMBOL)
(received_symbol, received_data) = abstractLayer1.readSymbol()
print(received_symbol.name)
#command = USERINPUT IN CONSOLE
command = command2
#Write / Specialize Query Symbol with dynamic user input
abstractLayer1.writeSymbol(QUERY_SYMBOL)
(received_symbol, received_data) = abstractLayer1.readSymbol()
print(received_symbol.name)
`
The text was updated successfully, but these errors were encountered: