Skip to content

Commit

Permalink
ble
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Dec 11, 2024
1 parent 464957d commit 7c04ee5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker/fxsupport/linux/bluetooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def prepare_response(self, response):
"index": 999, # Use max possible index digits
"data": ""
}
metadata_size = len(json.dumps(chunk_template)) * 2
metadata_size = len(json.dumps(chunk_template)) * 2 + 3
max_data_size = self.mtu_size - metadata_size

# Calculate chunks needed
Expand Down
12 changes: 9 additions & 3 deletions docker/fxsupport/linux/local_command_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,16 @@ def get_logs(self, params):
docker_logs = {}
for container in data.get('docker', []):
if container:
cmd = f"sudo docker logs {container} --tail 5"
cmd = f"sudo docker logs {container} --tail 6"
try:
output = subprocess.check_output(cmd, shell=True).decode('utf-8')
docker_logs[container] = output
# Capture both stdout and stderr
output = subprocess.check_output(
cmd,
shell=True,
stderr=subprocess.STDOUT, # Redirect stderr to stdout
universal_newlines=True # Handle text output properly
)
docker_logs[container] = output if output else "No logs available"
except subprocess.CalledProcessError as e:
docker_logs[container] = f"Error: {str(e)}"
result['docker'] = docker_logs
Expand Down

0 comments on commit 7c04ee5

Please sign in to comment.