Can't save UART output into custom key
Trying to save the output from my UART command to confirm the serial number that was programmed on the device. Whenever I try to show the serial number using THEKEY to the operator I just get "PASS" and not the expected contents of the key.
Here is the UART log
TX |
|
RX |
|
TX |
|
RX |
- ident: read serial number
- title: read serial number
steps:
- uartcmd: uart UART2
send: "\r\nconfig get SER_NUM \r\n"
expect: "2024\\d{9}"
extract: "2024\\d{9}"
extractKey: THEKEY
timeoutms: 2000
- command: operator %THEKEY%
Why is the THEKEY being assigned "PASS" and not the serial number if the expect is working?
|
-
Official comment
When using the `extract:` field, use parenthesis to specify the "capturing" group, as in:
- command: uart UART2
send: "\r\nconfig get SER_NUM\r\n"
extract: "(2024\\d{9})"
extractKey: THEKEY
timeout: 2sThe complete regular expressions syntax supported by the PLT is documented at https://github.com/google/re2/wiki/Syntax
Comment actions
Please sign in to leave a comment.
Comments
1 comment