Hello Paul
Thanks for the answer.
But sadly it is lacking any details.
It seems to me that PJRC is not willing to publish details about the Teensy tools.
I saw a request for the source code of these tools here in the forum 2 years ago that has never been answered by you.
https://forum.pjrc.com/threads/2632...post_compile-quot-and-quot-teensy_reboot-quot
Please think that there are people who use Teensy not just for playing around.
I use Teensy in a professional hardware that is used in many countries.
I do not want to tell my clients that they have to read a manual how to use PJRC tools.
I want to offer them a single button in my GUI to program a Teensy and therefore I need more details.
I have to know if programming was successful or not.
> A local host connection.
To which port ?
In TCPView I see that it opens port 3149.
Is this a fix port that is always used ?
In the verbose window I see the commands:
"auto: on"
which probably presses the green "Auto" button.
and then lots of
"status"
commands which probably request the programming result.
But what strings does the Teensy loader return on the "status" request?
I tried to capture with a packet sniffer but it does not capture local host connections.
In the code of Koromix I cannot find answers to these questions.
It would be all so easy if teensy_reboot would return an exit code of 0 if it failed and an exit code of 1 if programming was successful!
In C / C++ this is the return value of the main() function or you call ExitProcess() directly: See
MSDN
After establishing a connection to port 3149 I found out that all ascii commands are ignored if they do not end with a linefeed.
When the Teensy does not respond a programming request (because it was compiled with USB Type: No USB) the communication looks like this:
Sending 7 Bytes to Server (127.0.0.1):
'status\n'
Received:
'dir:E:\Hardware\Firmware\
file:Sketch.hex
readable:1
auto:1
online:0
online_count:0
offline_count:0
state:0
code_size:262144
EOT
'
And when the programming was successfull (after pressing the button on the board):
Sending 7 Bytes to Server (127.0.0.1):
'status\n'
Received:
'dir:E:\Hardware\Firmware\
file:Sketch.hex
readable:1
auto:1
online:0
online_count:1
offline_count:0
state:0
code_size:262144
EOT
'
So I deduce that online_count:1 means that the programming was successfull ?
What does all this stuff mean ?
state:0
readable:1
online:0
online_count:0
offline_count:0