New message to elect a new master.

When a master controller dies, a new master is elected at RFMonitor and
it is to be informed to the rfproxy and inturn all the devices. So a new
message type ELECT_MASTER is created that will be used by RFMonitor to
inform the rfproxy.

Signed-off-by: Srijan Mishra <srijan23mishra@gmail.com>
Acked-by: Joe Stringer joestringernz@gmail.com
Inform rfproxy about new master.

When the new master is elected, it is to be informed to to rfproxy so
that it may inform the same  to all the devices. So send the ELECT_MASTER
message to rfproxy so that it may inform all the devices about the new
master.

Signed-off-by: Srijan Mishra <srijan23mishra@gmail.com>
Acked-by: Joe Stringer joestringernz@gmail.com
Code Cleaning.

Removed unused code from RFMonitor. Removed log message introduced for
debugging. Removed the auto code generator from msgen.py that introduced
unused import.

Signed-off-by: Srijan Mishra <srijan23mishra@gmail.com>
Acked-by: Joe Stringer joestringernz@gmail.com
Code Documentation.

Added doc string to all the functions and described snippets at some
places.

Signed-off-by: Srijan Mishra <srijan23mishra@gmail.com>
Lock for eligible_masters

The data structure eligible_masters is being shared between IPC and main
thread. So for safe access, managed it with controller lock.

Signed-off-by: Srijan Mishra <srijan23mishra@gmail.com>
Code Documentation.

Documents RFMonitor class attributes and fixes a doc string.

Signed-off-by: Srijan Mishra <srijan23mishra@gmail.com>
Acked-by: Joe Stringer joestringernz@gmail.com
Assign max count to a variable.

eligible_masters was being used directly to access max count value. For
easier usage and code readability, assigned the required value to a
variable and use it everywhere.

Signed-off-by: Srijan Mishra <srijan23mishra@gmail.com>
Acked-by: Joe Stringer joestringernz@gmail.com