Retrieving text from UART and comparing

General discussion on mikroElektronika website & forums.
Post Reply
Author
Message
grangerdanger
Posts: 1
Joined: 12 Feb 2020 17:11

Retrieving text from UART and comparing

#1 Post by grangerdanger » 12 Feb 2020 17:19

Hello I've been making a PIC project that involves UART with SIM900.
If you know SIM900, it will reply OK on commands or ERROR if unsuccessful.
What I want is to Retrieve its reply using UART_Read_Text and compare it with a string.
My problem is:
I don't know how to use NULL as a delimiter.
I don't know how to compare received string.

In short what I want to do is:

UART1_Read_Text(reply,NULL,255);
if(reply=="ERROR")goto loop;

Can anyone fix that code? Thanks in advance

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: Retrieving text from UART and comparing

#2 Post by jovana.medakovic » 19 Feb 2020 12:26

Hello,

Unfortunately, we don't have any click board with this module, but you can search our Libstock and forum. Maybe some of our users shared their experiences.
For example:
viewtopic.php?f=88&t=71936&p=290493&hil ... 00#p290493
https://libstock.mikroe.com/projects/vi ... -for-learn

Also, check our GSM3 click example, it features the SIM800 module.
It may be useful.
http://www.libstock.com/projects/view/1212/gsm3-click
https://github.com/MikroElektronika/GSM_3_click

Kind regards,
Jovana

Post Reply

Return to “Website & Forums General Discussion”