This project is read-only.

Roles define the services offered by a particular type of device. For example, the role for a video camera with pan and tilt capabilities would include definitions for "up", "down", "left", and "right" while a binary sensor might just have "on" and "off". Roles are not specific to a particular device or app. Instead each role represents a set of capabilities which may be shared by many devices and apps.  When writing or extending device drivers and apps, you can use the predefined roles or create a custom role class if necessary. A more specific role can inherit the capabilities from a more basic (generic) role. For example, a Pan Tilt Camera role is a more specific role that inherits from the Camera role.  

Note that roles do not need to be baked into the platform. You can add a custom role class anywhere, as long as that class can be referenced by the driver and application modules that use it. They are purely an agreement between the app and driver. Inside the platform, message passing only understands lists of ParamTypes. What goes into the list is determined by the roles class. In the source code, some example roles are defined in Hub\Common\Common\role.cs. The RoleDummy class was created to demonstrate the preferred pattern for creating a role. 

Below is a list of existing roles with the hierarchy and operations for each: 

Inherits from

Role Name




RoleDummy : Role

A dummy example role

Echo; Echosub (subscribe to echo's)


RoleSensor : Role

Basic sensor role



RoleProximitySensor : Role

Proximity sensor



RoleActuator : Role

Actuate something



RoleSensorMultiLevel : Role

Multi-level sensor



RoleSwitchBinary : Role

A switch

Get, Set


RoleLightColor : Role

Color of the light

Get, Set


RoleMicrophone : Role

A microphone



RoleSkeletonTracker : Role

Provide skeleton tracker from Kinect v1

Lastskeleton, rcvskeletonstream


RoleSpeechReco : Role

Provides speech recognition (this is very naïve and has hardcoded simple grammar right now, uses Windows Speech SDK)




RoleHueBridge : Role

Bridge to Hue lights

Toggleall, turnoffall, turnonall, resetall, unlockall, setcolorall, setbrightnessall, togglebulb, turnoffbulb, turnonbulb, resetbulb, unlockbulb, setcolorbulb, getcolorbulb, setbrightnessbulb, bumpbulb


RoleDepthCam : Role

Depth Camera

Lastdepthimg, rcvdepthstream, lastdeptharray, rcvdeptharray


RoleCamera : Role

Basic Camera

Getimage, getvideo






RolePTCamera : RoleCamera

Pan Tilt camera

Getimage, getvideo, Up, down, left, right






RolePTZCamera : RolePTCamera

Pan Tilt zoom camera

Getimage, getvideo, Up, down, left, right

Zoomin, zoomout










RolePowerSensor : RoleSensorMultiLevel

Power MultiLevel Sensor



RoleTemperatureSensor : RoleSensorMultiLevel

Temperature sensor



RoleHumiditySensor : RoleSensorMultiLevel




RoleLuminositySensor : RoleSensorMultiLevel

Light level



RoleBatteryLevel : RoleSensorMultiLevel

Battery Level




RolePowerSensor : RoleSensorMultiLevel


Power sensor


Last edited May 10, 2014 at 2:35 AM by dannyh206, version 2


No comments yet.