Cellular: fix astyle for files that already in master

pull/10140/head
Teppo Järvelin 2019-03-18 13:50:10 +02:00
parent 6b84b14ab6
commit de7520bd97
8 changed files with 28 additions and 27 deletions

View File

@ -32,9 +32,9 @@
using namespace mbed;
GEMALTO_CINTERION_CellularStack::GEMALTO_CINTERION_CellularStack(ATHandler &atHandler, const char *apn, const char *user, const char* password,
GEMALTO_CINTERION_CellularStack::GEMALTO_CINTERION_CellularStack(ATHandler &atHandler, const char *apn, const char *user, const char *password,
int cid, nsapi_ip_stack_t stack_type) : AT_CellularStack(atHandler, cid, stack_type), _apn(apn),
_user(user), _password(password)
_user(user), _password(password)
{
}

View File

@ -24,7 +24,7 @@ namespace mbed {
class GEMALTO_CINTERION_CellularStack : public AT_CellularStack {
public:
GEMALTO_CINTERION_CellularStack(ATHandler &atHandler, const char *apn, const char *username, const char* password, int cid, nsapi_ip_stack_t stack_type);
GEMALTO_CINTERION_CellularStack(ATHandler &atHandler, const char *apn, const char *username, const char *password, int cid, nsapi_ip_stack_t stack_type);
virtual ~GEMALTO_CINTERION_CellularStack();
protected:

View File

@ -313,9 +313,9 @@ nsapi_size_or_error_t QUECTEL_BG96_CellularStack::socket_recvfrom_impl(CellularS
_at.cmd_start("AT+QIRD=");
_at.write_int(socket->id);
if (socket->proto == NSAPI_TCP) {
// do not read more than max size
// do not read more than max size
size = size > BG96_MAX_RECV_SIZE ? BG96_MAX_RECV_SIZE : size;
_at.write_int(size);
_at.write_int(size);
}
_at.cmd_stop();

View File

@ -64,5 +64,5 @@ nsapi_error_t UBLOX_AT_CellularNetwork::set_access_technology_impl(RadioAccessTe
}
}
return(ret);
return (ret);
}

View File

@ -40,7 +40,7 @@ UBLOX_N2XX::UBLOX_N2XX(FileHandle *fh): AT_CellularDevice(fh)
{
AT_CellularBase::set_cellular_properties(cellular_properties);
_at->set_urc_handler("+NPIN:", mbed::Callback<void()>(this, &UBLOX_N2XX::NPIN_URC));
memset(simstr,0,sizeof(simstr));
memset(simstr, 0, sizeof(simstr));
}
UBLOX_N2XX::~UBLOX_N2XX()
@ -113,18 +113,18 @@ nsapi_error_t UBLOX_N2XX::get_sim_state(SimState &state)
#if MBED_CONF_MBED_TRACE_ENABLE
switch (state) {
case SimStatePinNeeded:
tr_info("SIM PIN required");
break;
case SimStatePukNeeded:
tr_error("SIM PUK required");
break;
case SimStateUnknown:
tr_warn("SIM state unknown");
break;
default:
tr_info("SIM is ready");
break;
case SimStatePinNeeded:
tr_info("SIM PIN required");
break;
case SimStatePukNeeded:
tr_error("SIM PUK required");
break;
case SimStateUnknown:
tr_warn("SIM state unknown");
break;
default:
tr_info("SIM is ready");
break;
}
#endif
return error;

View File

@ -38,7 +38,7 @@ nsapi_size_or_error_t UBLOX_N2XX_CellularSMS::set_cscs(const char *chr_set)
}
nsapi_size_or_error_t UBLOX_N2XX_CellularSMS::get_sms(char *buf, uint16_t len, char *phone_num, uint16_t phone_len,
char *time_stamp, uint16_t time_len, int *buf_size)
char *time_stamp, uint16_t time_len, int *buf_size)
{
return NSAPI_ERROR_UNSUPPORTED;
}

View File

@ -78,7 +78,7 @@ nsapi_error_t UBLOX_N2XX_CellularStack::create_socket_impl(CellularSocket *socke
int sock_id = 0;
int localport = socket->localAddress.get_port();
if(localport == 5683 || localport < 0 || localport > 65535) {
if (localport == 5683 || localport < 0 || localport > 65535) {
return NSAPI_ERROR_NO_SOCKET;
}
@ -113,7 +113,7 @@ nsapi_error_t UBLOX_N2XX_CellularStack::create_socket_impl(CellularSocket *socke
}
nsapi_size_or_error_t UBLOX_N2XX_CellularStack::socket_sendto_impl(CellularSocket *socket, const SocketAddress &address,
const void *data, nsapi_size_t size)
const void *data, nsapi_size_t size)
{
if (size > N2XX_MAX_PACKET_SIZE) {
return NSAPI_ERROR_PARAMETER;
@ -121,9 +121,10 @@ nsapi_size_or_error_t UBLOX_N2XX_CellularStack::socket_sendto_impl(CellularSocke
int sent_len = 0;
char *dataStr = new char [(size * 2) + 1]();
if (!dataStr)
if (!dataStr) {
return NSAPI_ERROR_NO_MEMORY;
char_str_to_hex_str((const char*)data, size, dataStr);
}
char_str_to_hex_str((const char *)data, size, dataStr);
_at.cmd_start("AT+NSOST=");
_at.write_int(socket->id);
@ -147,7 +148,7 @@ nsapi_size_or_error_t UBLOX_N2XX_CellularStack::socket_sendto_impl(CellularSocke
}
nsapi_size_or_error_t UBLOX_N2XX_CellularStack::socket_recvfrom_impl(CellularSocket *socket, SocketAddress *address,
void *buffer, nsapi_size_t size)
void *buffer, nsapi_size_t size)
{
nsapi_size_or_error_t nsapi_error_size = NSAPI_ERROR_DEVICE_ERROR;
nsapi_size_t read_blk, usorf_sz, count = 0, length = size;

View File

@ -63,10 +63,10 @@ protected:
virtual nsapi_error_t create_socket_impl(CellularSocket *socket);
virtual nsapi_size_or_error_t socket_sendto_impl(CellularSocket *socket, const SocketAddress &address,
const void *data, nsapi_size_t size);
const void *data, nsapi_size_t size);
virtual nsapi_size_or_error_t socket_recvfrom_impl(CellularSocket *socket, SocketAddress *address,
void *buffer, nsapi_size_t size);
void *buffer, nsapi_size_t size);
virtual nsapi_error_t socket_close_impl(int sock_id);