Im trying to send a sms containing byte values within the message. Im having difficulty understanding how to use the control codes to put the message together ina way the compiler can accept and also that module will understand.
The line of code below will work fine. The byte values b0 to b9 hold the number the sms is to go to. I enclose these byte values within the two 34,34's rather than " and " because that seems to be the only way the thing will go through. I havent bothered mroe with it than that bacause it works fine and Ive got enough to stress over as it is.
hserout 0,("AT+CMGS=",34,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,34,13,"DIPPY IS FULL OF WORDS OF LOVE",26)
The line of code below doesn't work.
hserout 0,("AT+CMGS=",34,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,34,13"THE BATTERY LEVEL IS,40,b10,41,40,b11,41",26)
As before the destination number is held in the bytes b0 to b9. I then want to send a two numeral number which reprsents the battery level's state of charge as a precentile which is contained with bytes b10 and b11. I thought maybe they should be enclosed in brackets.
In practice I also want to add a % sign after the two byte values but I have left that out for clarity.
The messge should read at the recieving end "The battery charge level is 40%"
At the moment the compiler will accpet this command but the module dosent send it.
The 26 (ctrl z) tells the module thats the end of the message and to switch from taking in text mode back to at command mode.
So the issue is I think how do I put the message together so the compiler understands b10 and b11 per se arent part of the message but rather contain values that are. Im sure its straight forward to the more experience players. Any advice appreciated. (espscially from that old honey dripper Dippy).
hserout 0,("AT+CMGS=",34,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,34,13"THE BATTERY LEVEL IS,40,b10,41,40,b11,41",26)
The line of code below will work fine. The byte values b0 to b9 hold the number the sms is to go to. I enclose these byte values within the two 34,34's rather than " and " because that seems to be the only way the thing will go through. I havent bothered mroe with it than that bacause it works fine and Ive got enough to stress over as it is.
hserout 0,("AT+CMGS=",34,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,34,13,"DIPPY IS FULL OF WORDS OF LOVE",26)
The line of code below doesn't work.
hserout 0,("AT+CMGS=",34,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,34,13"THE BATTERY LEVEL IS,40,b10,41,40,b11,41",26)
As before the destination number is held in the bytes b0 to b9. I then want to send a two numeral number which reprsents the battery level's state of charge as a precentile which is contained with bytes b10 and b11. I thought maybe they should be enclosed in brackets.
In practice I also want to add a % sign after the two byte values but I have left that out for clarity.
The messge should read at the recieving end "The battery charge level is 40%"
At the moment the compiler will accpet this command but the module dosent send it.
The 26 (ctrl z) tells the module thats the end of the message and to switch from taking in text mode back to at command mode.
So the issue is I think how do I put the message together so the compiler understands b10 and b11 per se arent part of the message but rather contain values that are. Im sure its straight forward to the more experience players. Any advice appreciated. (espscially from that old honey dripper Dippy).
hserout 0,("AT+CMGS=",34,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,34,13"THE BATTERY LEVEL IS,40,b10,41,40,b11,41",26)