Tuesday, November 12, 2019

How to move a lambda function from one AWS account to another?

Its very simple to move lambda function from one aws account to another aws account.

1) From source aws account , goto lambda function code and from top right corner, click the actions menu. From actions menu select export function option. When you select this option , it will ask you to select one of the following options as shown in figure. Select "Download deployment package".

Deployment package would be downloaded as a .zip file.

2) Now goto target aws account and browse through its lambda console and create a lambda function.
Once function is created, goto  function code window and select an option of "code entry  type"  as shown in figure and select "upload code from" .zip file . and Import the package exported in step 1.



Saturday, August 17, 2019

Bluetooth device address for BLE devices


BLE Device Address

BLE devices are identified by 48 bit device address. This address could either be a public device address or random device address. A device shall  have at-least one address however  it can have both.


Public Address

Public device shall be created according to IEEE standard and should have following format:

Random Address  

Random address could be of following sub types :
  1. Static Address
  2. Private Address
The term random address  refers to both static and random address.

Static Address 

A static device address is randomly generated 48 bit address with following requirements :

  • 2 most significant bits of the address shall be equal to 1 .
  • All bits of the random address shall not be equal to 1.
  • All bits of random address shall not be equal to 0.
This is the format for static address:

  •  A device may choose to initialize its static address to new value at power cycle. A device shall not change its static address once its initialized till its power cycled again.

Private Address

Private Address could be of  2 types:
  • Resolvable Private Address(RPA)
  • Non Resolvable Private Address (Non RPA)

Resolvable Private Address

 Resolvable private address format is as shown below :



To generate a resolvable private address , device must either have the Local Identity Resolving key or peer Identity Resolving Key. Resolvable Private Address shall be generated with IRK and 24 bit random number known as prand. The hash is generated with random address function.

 Non Resolvable Private Address

Format of non resolvable private address format is as shown below:

 

Non Resolvable Private Address should meet following requirements
  • Two most significant bytes should be equal to zero.
  • all bits of random part of the address shall not be equal to 1.
  • All bits of random part of the address shall not e equal to 0.
  • The address shall not be equal to public address.