Comments (1)
From @brezinapeto on February 26, 2016 8:19
What I did in my GSM libraries :
void GSM3MobileServerService::stop()
{
// Review, should be the server?
/*theGSM3MobileClientProvider->disconnectTCP(local1Remote0, mySocket);
if(flags & GSM3MOBILESERVERSERVICE_SYNCH)
waitForAnswer();
theGSM3MobileClientProvider->releaseSocket(mySocket);*/
theGSM3MobileServerProvider->disconnectTCPServer(mySocket); //PBR modification
if(flags & GSM3MOBILESERVERSERVICE_SYNCH)
waitForAnswer();
theGSM3MobileClientProvider->releaseSocket(mySocket);
mySocket = -1;
}
//Disconnect Server main function. PBR modification
int GSM3ShieldV1ServerProvider::disconnectTCPServer(uint8_t socket)
{
// id Socket does not really mean anything, in this case we have
// only one socket running
theGSM3ShieldV1ModemCore.openCommand(this,DISCONNECTTCP);
// If we are not closed, launch the command
//[ZZ] if(theGSM3ShieldV1ModemCore.getStatus()==TRANSPARENT_CONNECTED)
// {
delay(1000);
theGSM3ShieldV1ModemCore.print("+++");
delay(1000);
theGSM3ShieldV1ModemCore.genericCommand_rq(PSTR("AT+QISRVC=2"));//PBR modification
theGSM3ShieldV1ModemCore.genericCommand_rq(PSTR("AT+QICLOSE"));
theGSM3ShieldV1ModemCore.setStatus(GPRS_READY);
// }
// Looks like it runs everytime, so we simply flush to death and go on
do
{
// Empty the local buffer, and tell the modem to XON
// If meanwhile we receive a DISCONNECT we should detect it as URC.
theGSM3ShieldV1ModemCore.theBuffer().flush();
theGSM3ShieldV1ModemCore.gss.spaceAvailable();
// Give some time for the buffer to refill
delay(100);
theGSM3ShieldV1ModemCore.closeCommand(1);
}while(theGSM3ShieldV1ModemCore.theBuffer().storedBytes()>0);
theGSM3ShieldV1ModemCore.unRegisterUMProvider(this);
return theGSM3ShieldV1ModemCore.getCommandError();
}
from gsm.
Related Issues (14)
- Arduino mega problem
- Mega UART3 pins
- Error -2 on second post call
- Has a bug when receive pdu SMS.
- SIM900 Connection with this library?
- GSM SMS encoding problem HOT 1
- [GSM library] Problem with letter "w" HOT 1
- THREE New GSM Shields v2 - GSM Library Scrap HOT 1
- Retire this library?
- GsmWebClient example for GSM shield v2 does not work since v.1.5.7 HOT 1
- GSMClient::read() returns 0 rather than -1 if there's no data available
- GSM sunset is arriving...there is a plan to offer/suggest some other kind of similar communication shield?
- fix for GSMTestModem not working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gsm.