| 8 | int pictureSize; |
| 9 | |
| 10 | bool 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 | |