mates,I have a set top box which I am communicating through serial port.This box has Gstreamer media frame-work(linux platform and C language). I am trying to automate Gstreamer i.e gst-launch,gst-inspect....there are also other frame work like Qt which I want to automate. Following are my attempts toward this problems : Attempt 1: Tried using Pyserial and was successful toward working of it,but by using Pyserial I was able to access my port and communicate to my board,but I found no way to automate things.
import serial
import time
port = "COM1"
baud = 115200
ser = serial.Serial(port, baud,xonxoff=False, rtscts=False, dsrdtr=False,timeout=None)
ser.flushInput()
ser.flushOutput()
if ser.isOpen():
print(ser.name + ' is open...')
while True :
cmd = input("Enter command or 'exit':")
if cmd == 'exit':
ser.close()
exit()
else:
ser.write(cmd.encode() + b'\r\n' )
bytesToRead = ser.inWaiting()
out=ser.read(bytesToRead)
print(out.decode(),sep='')
Attempt 2 : To have a communicator install in my board which can communicate to my box. If this is correct ,I have no Idea how to proceed with this.
Any help toward STB automation will be greatly appreciated.