RUI3 (RAK Unified Interface 3) - RAK4631
pword

Functions

bool set (char *passwd, uint32_t len)
 
void lock (void)
 
void unlock (void)
 

Detailed Description

Function Documentation

◆ set()

bool set ( char *  passwd,
uint32_t  len 
)
Description
This api allow user to set a 1~8 digits password to lock the default serial
Syntax
api.system.pword.set(passwd_Str)
api.system.pword.set(passwd_Char, len)
Parameters
passwd_Strthe password to lock the Default Serial(Type: String)
passwd_Charthe password to lock the Default Serial(Type: cahr *)
lenthe length of passwod
Returns
bool
Return values
TRUEfor successfully set a password
FALSEfor set a password failure
Example
int loopCount = 0;

void setup()
{
  String password = "12345678";
  api.system.pword.set(password); // set the password to 12345678
  api.system.pword.lock();        // lock the default port 
}

void loop()
{
  loopCount++; 

      if (loopCount == 60)
        api.system.pword.unlock();   // unlock the default port after 60 seconds

  delay(1000);
}

◆ lock()

void lock ( void  )
Description
This api allow user to lock the default serial with the pass set in api.system.pword.set()
Note
If you never set a password successfully, the default password will be 00000000
Syntax
api.system.pword.lock()
Returns
void
Example
    int loopCount = 0;

    void setup()
    {
      String password = "12345678";
      api.system.pword.set(password); // set the password to 12345678
      api.system.pword.lock();        // lock the default port
    }

    void loop()
    {
      loopCount++;

      if (loopCount == 60)
        api.system.pword.unlock();   // unlock the default port after 60 seconds

      delay(1000);
    }

◆ unlock()

void unlock ( void  )
Description
This api allow user to unlock the default serial without password when it'locked
Syntax
api.system.pword.unlock()
Returns
void
Example
    int loopCount = 0;

    void setup()
    {
      String password = "12345678";
      api.system.pword.set(password); // set the password to 12345678
      api.system.pword.lock();        // lock the default port
    }

    void loop()
    {
      loopCount++;

      if (loopCount == 60)
        api.system.pword.unlock();   // unlock the default port after 60 seconds

      delay(1000);
    }