I don't know a single word of French. My bad. But, there is almighty Google.
I read your article, and it is nicely written. I hope the translation didn't change a lot of it. And I said that as a long time reviewer in a computer magazine, with hundreds of articles. 
Back to the topic. Your example is pretty nice, except there is nothing as I can see that will return the incoming data without following new line and OK. There is:
fakeDevice.endCommand("Hi", 5000ul, tempBuffer, 100);
Here, I wait for Hi, and return the data. But how to return Hi and not the following? Beside, here you wait for a known word, in my case, GPS will send unkown data. This part is not clear to me. I am waiting for numbers, dots and commas. This is what I expect (20.45847,40.2569). Data is fake, not true position of me. 
Anything after that should be ignored.
In any case, here is the sketch I am up to till now. With added lines you suggested here.
#include <StreamDevice.h>
StreamDevice A9G(Serial1);
int bID = 1;
int delayTime = 10000;
int gpsData;
void setup()
{
Serial.begin(9600);
Serial1.begin(9600);
initGSM();
initGPS();
initGPRS();
connectGSM("ATE0","OK");
}
void loop(){
//connectGPS();
A9G.println("AT+LOCATION=2");
A9G.endCommand("OK\r\n", 5000ul); // Once done, tell the A9G that the command is done (wait default to 1s, you can add the timeout as a parameter - herer 5s)
if (A9G.awaitKeyword() == KEYWORD_OK) // this is blocking until timeout or correct answer whichever comes first
Serial.println(F("Got the expected 'OK' text"));
// here should be printed the GPS data only, if I am right
else
Serial.println(F("Damned - timed out before getting the expected 'OK'"));
delay(5000);
}
void initGPS(){
connectGSM("AT+GPS=1","OK");
}
void initGSM(){
connectGSM("AT","OK");
connectGSM("ATE1","OK");
connectGSM("AT+CPIN?","READY");
}
void initGPRS(){
connectGSM("AT+CREG=0","OK");
connectGSM("AT+CREG?","0,1");
connectGSM("AT+CIPSTATUS?","IP INITIAL");
connectGSM("AT+CGDCONT=1,\"IP\",\"apn\"","OK");
connectGSM("AT+CGATT=1","OK");
connectGSM("AT+CGACT=1,1","OK");
delay(1000);
}
void connectGPS (){
Serial1.println("AT+LOCATION=2");
Serial1.flush();
while(Serial1.available()>0){
String cstring = Serial1.readStringUntil('\r');
Serial.println(cstring);
delay(1000);
}
}
void connectGSM (String cmd, char *res){
while(1){
Serial.println(cmd);
Serial1.println(cmd);
delay(500);
while(Serial1.available()>0){
if(Serial1.find(res)){
Serial.println(res);
delay(1000);
return;
}
}
delay(1000);
}
}
Serial is 9600, it is the only one that works. Not sure why.
Anyway, I think you clearly understand the lines above.