Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

GPRS init #16

Closed
TheAce58 opened this issue Apr 21, 2022 · 0 comments
Closed

GPRS init #16

TheAce58 opened this issue Apr 21, 2022 · 0 comments
Assignees
Labels
GPRS_Shield_Suli Label for GPRS_Shield_Suli UAY Unassigned yet

Comments

@TheAce58
Copy link

TheAce58 commented Apr 21, 2022

Hi,

I saw your sendSMS function and was wondering if your initialization condition is false or not. Here is your code :

`
void setup() {

Serial.begin(9600);

while (0 != gprsTest.init()) {
    delay(1000);

    Serial.print("init error\r\n");

}

Serial.println("gprs init success");

Serial.println("start to send message ...");

gprsTest.sendSMS(PHONE_NUMBER, MESSAGE); //define phone number and text

}
`

I see here that your condition is waiting for a 0, or a false in the gprs.init() method.
But if we go to your GPRS_Shield_Arduino.cpp file, we see that the function returns true if everything went well. Why do you wait for a false to say if the initialization was successful ? Here is the code :

`
int GPRS::init(void) {
if (0 != sim900_check_with_cmd("AT\r\n", "OK\r\n", CMD)) {
return false;

}

if (0 != sim900_check_with_cmd("AT+CFUN=1\r\n", "OK\r\n", CMD)) {
    return false;

}

if (0 != checkSIMStatus()) {
    return false;

}

return true;

}
`

Is there anything I have misunderstood ?

Best regards.

@MatthewJeffson MatthewJeffson added UAY Unassigned yet GPRS_Shield_Suli Label for GPRS_Shield_Suli labels Oct 9, 2024
@Lesords Lesords self-assigned this Oct 15, 2024
@baorepo baorepo closed this as completed Oct 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
GPRS_Shield_Suli Label for GPRS_Shield_Suli UAY Unassigned yet
Projects
Status: Done
Development

No branches or pull requests

4 participants