MCPcopy Create free account
hub / github.com/SmingHub/Sming / processSize

Function processSize

Sming/Libraries/AtClient/samples/Webcam/app/application.cpp:10–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8int pictureSize;
9
10bool processSize(AtClient& atClient, String& reply)
11{
12 /*
13 * ================
14 AT+CAMCAP capture picture
15 Set Command:
16 Capture and store a Picture local and returns bytes of captured picture
17 AT+CAMCAP
18 +CAMCAP:<bytes>
19 OK
20 on error:
21 +CME ERROR:
22 * ================
23 */
24 if(reply.indexOf("+CME ERROR") == 0) {
25 debug_e("Unable to capture image");
26 return false;
27 }
28
29 // Read the size of the captured image
30 String length = reply.substring(8);
31 pictureSize = atoi(length.c_str());
32
33 debug_d("Picture size: %d", pictureSize);
34
35 return true;
36}
37
38} // namespace
39

Callers

nothing calls this directly

Calls 3

indexOfMethod · 0.45
substringMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected