| 137 | |
| 138 | export class JLinkSocketRTTSource extends SocketRTTSource { |
| 139 | constructor(tcpPort: string, public readonly channel: number) { |
| 140 | super(tcpPort, channel); |
| 141 | |
| 142 | // When the TCP connection to the RTT port is established, send config commands |
| 143 | // within 100ms to configure the RTT channel. See |
| 144 | // https://wiki.segger.com/RTT#SEGGER_TELNET_Config_String for more information |
| 145 | // on the config string format. |
| 146 | this.on('connected', () => { |
| 147 | this.write(`$$SEGGER_TELNET_ConfigStr=RTTCh;${channel}$$`); |
| 148 | }); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | enum PeHeaderType { |