Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getIMEI #2

Open
dayslav opened this issue Apr 22, 2018 · 0 comments
Open

getIMEI #2

dayslav opened this issue Apr 22, 2018 · 0 comments

Comments

@dayslav
Copy link

dayslav commented Apr 22, 2018

Hi, this code for getIMEI function work much better for me.

String AIS_NB_BC95:: getIMEI()
{
String data = "";
_Serial->println(F("AT+CGSN=1"));
AIS_NB_BC95_RES res = wait_rx_bc(3000,F("+CGSN"));
if(res.status)
{
data = res.data;
int index = data.indexOf(F(":"));
int index2 = data.indexOf(F("\r"));
data = res.data.substring(index+1,index2);

}else {data = "";}
res = wait_rx_bc(500,F("OK"));
return data;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant