blob: 590b7ace1f40c5add5591b54fff029e86072c151 [file] [log] [blame]
Anthony DiGirolamof90c6692024-07-13 22:13:34 +00001# This is a pw_console config file that defines a default window layout.
2# For more info on what can be added to this file see:
3# https://pigweed.dev/pw_console/py/pw_console/docs/user_guide.html#configuration
4config_title: pw_console
5
6# Window layout
7windows:
8 # Left split with tabbed views.
9 Split 1 tabbed:
10 Python Repl:
11 hidden: False
12 # Right split with stacked views.
13 Split 2 stacked:
14 Device Logs:
15 hidden: False
16 Host Logs:
17 hidden: False
Anthony DiGirolamo14156262024-07-19 17:06:14 +000018 Pubsub Events:
19 loggers:
20 device.pubsub_events:
21 level: DEBUG
22 hidden: False
Anthony DiGirolamof90c6692024-07-13 22:13:34 +000023
24# Color options
25ui_theme: dark
26# ui_theme: nord
27# ui_theme: high-contrast-dark
28code_theme: pigweed-code
29# code_theme: pigweed-code-light
30# code_theme: gruvbox-dark
31swap_light_and_dark: False
32
33# Display options
34spaces_between_columns: 2
35window_column_split_method: vertical
36# window_column_split_method: horizontal
37# hide_date_from_log_time: True
Anthony DiGirolamo14156262024-07-19 17:06:14 +000038recolor_log_lines_to_match_level: False
Anthony DiGirolamof90c6692024-07-13 22:13:34 +000039
40snippets:
41 Echo RPC:
42 code: |
43 device.rpcs.pw.rpc.EchoService.Echo(msg='hello world')
44 description: |
45 Send a string to the device and receive a response with the same
46 message back.
47
48 >>> device.rpcs.pw.rpc.EchoService.Echo(msg='hello world')
49 (Status.OK, pw.rpc.EchoMessage(msg='hello world'))
50
51 Reboot to bootloader:
52 code: |
53 device.rpcs.board.Board.Reboot(reboot_type=1)
54 description: |
55 Sent a reboot request to the device. The console must be
56 relaunched to reconnect.
57
58 Get onboard temp sensor value:
59 code: |
60 device.rpcs.board.Board.OnboardTemp()
61 description: |
62 Get the current value of the onboard temperature sensor.
63
64 ```pycon
65 >>> device.rpcs.board.Board.OnboardTemp()
66 (Status.OK, board.OnboardTempResponse(temp=24.797744750976562))
67 ```
68
69 Log onboard temp sensor values every 1000ms:
70 code: |
71 call = device.rpcs.board.Board.OnboardTempStream.invoke(
72 request_args=dict(sample_interval_ms=1000),
73 on_next=lambda _, message: LOG.info(message)
74 )
75 description: |
76 Start logging with:
77
78 ```pycon
79 >>> call = device.rpcs.board.Board.OnboardTempStream.invoke(request_args=dict(sample_interval_ms=1000), on_next=lambda _, message: LOG.info(message))
80 ```
81
82 Log messages will appear in the 'Host Logs' window.
83 To stop the streaming RPC run `call.cancel()`:
84
85 ```pycon
86 >>> call.cancel()
87 True
88 ```
89
90# TODO: Make snippets for the following RPCs
91# device.rpcs.blinky.Blinky.ToggleLed
92# device.rpcs.blinky.Blinky.Blink
93# device.rpcs.blinky.Blinky.Pulse
94# device.rpcs.blinky.Blinky.SetRgb
95# device.rpcs.blinky.Blinky.Rainbow
96# device.rpcs.blinky.Blinky.IsIdle
97# device.rpcs.morse_code.MorseCode.Send
98