Hi,
Does anyone has implemented commadline input based sample code in which system is waiting to accept input from user on terminal and based on input system will parse it and perform operation as per command.? This is something like redline library used in Linux System.
Please let me know if anyone has implemented that type of command line application into ESP32..
Command line sample code to accept custom command as input
Command line sample code to accept custom command as input
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Command line sample code to accept custom command as input
Howdy Ritesh,
Does your question substantially differ from this one:
http://esp32.com/viewtopic.php?f=2&t=732
Does your question substantially differ from this one:
http://esp32.com/viewtopic.php?f=2&t=732
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Command line sample code to accept custom command as input
Hi,
Please let me know if anyone has implemented such kind of command line code which will ask for input and will perform operation for WiFi or UART or other interface test-cases based on input.
As I have checked with scanf function but some how its not working as not able to stop execution process where I have put scanf function.
So, if anyone has any idea instead of scanf to create any command line application then please let me know.
Please let me know if anyone has implemented such kind of command line code which will ask for input and will perform operation for WiFi or UART or other interface test-cases based on input.
As I have checked with scanf function but some how its not working as not able to stop execution process where I have put scanf function.
So, if anyone has any idea instead of scanf to create any command line application then please let me know.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Command line sample code to accept custom command as input
hiRitesh wrote:Hi,
Please let me know if anyone has implemented such kind of command line code which will ask for input and will perform operation for WiFi or UART or other interface test-cases based on input.
As I have checked with scanf function but some how its not working as not able to stop execution process where I have put scanf function.
So, if anyone has any idea instead of scanf to create any command line application then please let me know.
like Neil mentioned its a good start for go.
where is the problem in your code or hang ritesh?
where you can not go on?
i understand , that you want build "Telnet" like console command app,
so you need uart and isr on Rx example if you want communicate by uart.
check the incomming char on isr and make char++ while for end char what you want example \n
after this, you can check the buffer what user have give as input.
with this check you can work then with the "request" buffer and do the things what you want to do
example ping a client.
the response you can refer to the user console example.
you can build a long command list like "AT Commands"
this you can enumerate and switch this idx to the case for the command.
not sure, what you mean with "scanf" problem
the char comes with the isr on Rx example, you need only read this char on each isr. ( uart )
if you mean, you want build a wifi console ( Telnet service )
than you can do the same with the recv buffer on wifi.
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Who is online
Users browsing this forum: Google [Bot] and 72 guests