Skip to content

Commit faef414

Browse files
committed
GEMALTO CONTERION: add ping
1 parent 68cb8fb commit faef414

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,23 @@ void GEMALTO_CINTERION_CellularStack::PSMDisable() {
224224
}
225225
}
226226

227+
int GEMALTO_CINTERION_CellularStack::ping(const char *host, int ttl)
228+
{
229+
MBED_ASSERT(host);
230+
231+
_at.lock();
232+
_at.set_at_timeout(ttl + 1000);
233+
_at.cmd_start_stop("^SISX", "=", "%s%d%s%d%d", "Ping", _cid, host, 1, ttl);
234+
_at.resp_start("^SISX: \"Ping\",");
235+
_at.skip_param(3); //pingInfoType, conProfileId, ip-address
236+
int rTT = _at.read_int(); //roundTripTime
237+
_at.resp_stop();
238+
_at.clear_error();
239+
_at.restore_at_timeout();
240+
_at.unlock();
241+
return rTT;
242+
}
243+
227244
nsapi_error_t GEMALTO_CINTERION_CellularStack::socket_stack_init()
228245
{
229246
_at.lock();

connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class GEMALTO_CINTERION_CellularStack : public AT_CellularStack {
4343
void stopGNSS();
4444
void PSMEnable();
4545
void PSMDisable();
46+
int ping(const char *host, int ttl);
4647

4748
protected:
4849

0 commit comments

Comments
 (0)