Cellular: Fixing to skip greentea test if sim pin is not configured.

pull/6496/head
Teppo Järvelin 2018-04-09 10:22:31 +03:00
parent b3226acbbf
commit 9c185d9b63
1 changed files with 11 additions and 7 deletions

View File

@ -26,6 +26,10 @@
#error [NOT_SUPPORTED] CELLULAR_DEVICE must be defined
#endif
#ifndef MBED_CONF_APP_CELLULAR_SIM_PIN
#error [NOT_SUPPORTED] SIM pin code is needed. Skipping this build.
#endif
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
@ -55,13 +59,13 @@ static SocketAddress echo_server_addr;
class EchoSocket : public UDPSocket {
public:
EchoSocket(int size) : UDPSocket(), _async_flag(0), _data(0), _size(size) {
}
virtual ~EchoSocket() {
delete _data;
}
void set_async(int async) {
_async_flag = async;
EchoSocket(int size) : UDPSocket(), _async_flag(0), _data(0), _size(size) {
}
virtual ~EchoSocket() {
delete _data;
}
void set_async(int async) {
_async_flag = async;
if (_async_flag) {
set_blocking(false);
sigio(callback(this, &EchoSocket::async_callback));