Sending battery info attached with GSM through SMS
1) AT+CMGS must go before the body of sms (place bat() after transmit())

2) You're not detecting the end of answer to AT+CBC command, that's poor way. You must receive symbols until you've get "OK"