Skip to content

Commit

Permalink
fix trailng white space
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoErmini committed Apr 24, 2015
1 parent 52b5cee commit 0b67857
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion drivers/include/xbee.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#define XBEE_DEFAULT_CHANNEL (17U)

/**
* @brief Encryption key length in bytes (128 bit AES encryption)
* @brief Encryption key length in bytes (128 bit AES encryption)
*/
#define XBEE_ENCRYPTION_KEY_LEN (16U)

Expand Down
12 changes: 5 additions & 7 deletions drivers/xbee/xbee.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ static int _set_proto(xbee_t *dev, uint8_t *val, size_t len)
}

static int _set_encryption(xbee_t *dev, uint8_t *val, size_t len)
{
dev->encrypt = *val; //store the current encryption status
{
dev->encrypt = *val; //store the current encryption status
uint8_t cmd[3];
resp_t resp;
/* get the current state of Encryption */
Expand All @@ -400,18 +400,16 @@ static int _set_encryption(xbee_t *dev, uint8_t *val, size_t len)
cmd[0] = 'E';
cmd[1] = 'E';
cmd[2] = val[0];
_api_at_cmd(dev, cmd, 3, &resp);
_api_at_cmd(dev, cmd, 3, &resp);
}
if (resp.status == 0) {
return 2;
}

return -ECANCELED;
return -ECANCELED;
}

static int _set_encryption_key(xbee_t *dev, uint8_t *val, size_t len)
{

uint8_t cmd[18];
resp_t resp;
if (len != 16) { //the AES key is 128bit, 16 byte
Expand Down Expand Up @@ -694,7 +692,7 @@ static int _set(ng_netdev_t *netdev, ng_netconf_opt_t opt,
case NETCONF_OPT_ENCRYPTION:
return _set_encryption(dev, (uint8_t *) value, value_len);
case NETCONF_OPT_ENCRYPTION_KEY:
return _set_encryption_key(dev, (uint8_t *)value, value_len);
return _set_encryption_key(dev, (uint8_t *)value, value_len);
default:
return -ENOTSUP;
}
Expand Down
3 changes: 1 addition & 2 deletions tests/driver_xbee/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ int main(void)
puts("Error initializing MAC layer");
return -1;
}

/* optionally en/disable and set Xbee encryption key */
#ifdef OPT_ENCRYPTION
ng_netconf_enable_t encrypt = NETCONF_ENABLE; /* warning: use NETCONF_DISABLE before
ng_netconf_enable_t encrypt = NETCONF_ENABLE; /* warning: use NETCONF_DISABLE before
* set OPT_ENCRYPTION to undefined */
static uint8_t key_buf[XBEE_ENCRYPTION_KEY_LEN]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; // change those value to match your key
Expand Down

0 comments on commit 0b67857

Please sign in to comment.