Skip to content

Commit ec90925

Browse files
committed
Return unsigned int in readVoltage function
1 parent a24da57 commit ec90925

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Http.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@ void HTTP::wakeUp(){
172172
if (sendATTest() != TRUE) preInit();
173173
}
174174

175-
void HTTP::readVoltage(char *voltage){
175+
unsigned int HTTP::readVoltage(){
176176
char buffer[64];
177+
char voltage[8];
177178
cleanBuffer(buffer, sizeof(buffer));
178179
cleanBuffer(voltage, sizeof(voltage));
179180

@@ -190,6 +191,7 @@ void HTTP::readVoltage(char *voltage){
190191
voltage[i - voltageValueStartIndex + 1] = '\0';
191192
}
192193
}
194+
return atoi(voltage);
193195
}
194196

195197
Result HTTP::setHTTPSession(const char *uri){

Http.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class HTTP : public SIM800 {
6363
Result post(const char *uri, const char *body, char *response);
6464
void sleep();
6565
void wakeUp();
66-
void readVoltage(char *voltage);
66+
unsigned int readVoltage();
6767

6868
private:
6969
void readResponse(char *response);

0 commit comments

Comments
 (0)