Move Nanostack connect semaphore into object

Connect semaphore was being constructed and consuming RAM even if
Nanostack isn't in use. Avoid this by moving it into the class, where it
should be anyway.
Kevin Bracey 2016-06-07 14:30:11 +01:00
parent 30a5366927
commit 4eb394e391
2 changed files with 3 additions and 2 deletions

View File

@ -107,8 +107,7 @@ private:
socket_mode_t mode;
};
static Semaphore connect_semaphore(0);
static NanostackSocket * socket_tbl[NS_INTERFACE_SOCKETS_MAX] = {0};
static NanostackSocket * socket_tbl[NS_INTERFACE_SOCKETS_MAX];
static int map_mesh_error(mesh_error_t err)
{

View File

@ -13,6 +13,7 @@
class NanostackInterface : public MeshInterface, public NetworkStack {
public:
NanostackInterface() : connect_semaphore(0) { }
int disconnect();
/** Get the internally stored IP address
@ -226,6 +227,7 @@ protected:
uint8_t eui64[8];
char ip_addr_str[40];
char mac_addr_str[24];
Semaphore connect_semaphore;
};
class LoWPANNDInterface : public NanostackInterface {